* Segher Boessenkool: > Hi! > > On Fri, Jul 18, 2025 at 06:39:41PM +0200, David Brown wrote: >> > While this is true in principle, it's not how -fwrapv (or undefined signed >> > overflow) is implemented in GCC. When writing optimizations, you have >> > to be careful not to introduce signed overflow that was not present in >> > the original code because there aren't separate tree operations for >> > wrapping and overflowing operations. >> > >> > There aren't many examples like this in the code base today, perhaps >> > because -fwrapv is not the default and any such optimization would not >> > get used much. But here's one: > > There isn't much in the GCC code that deals with -fwrapv at all. > "grep flag_wrapv" finds 29 occurrences only, and 3 more in config/ (all > for Andes). I think most uses are hidden behind TYPE_OVERFLOW_WRAPS and TYPE_OVERFLOW_UNDEFINED. Thanks, Florian