https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30484
--- Comment #15 from rguenther at suse dot de <rguenther at suse dot de> --- On Mon, 23 Aug 2021, vincent-gcc at vinc17 dot net wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30484 > > --- Comment #14 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> --- > Well, you could change the definition of -fwrapv in the same way that the > standard has changed. I mean that the intent of making INT_MIN / -1 undefined > was *only* for a performance reason (not for a mathematical reason). Normally, > -fwrapv should be as fast as without it (except for some optimizations like > VRP, but I would actually expect a program based on -fwrapv to be faster in > general, because the programmer does not have to care about intermediate > overflows). On the contrary - -fwrapv allows the compiler to make less assumptions and thus usually results in slower code. Given overflow is undefined with -fno-wrapv the actual operation code generation can generate the same code as with -fwrapv so it should never be slower even on the machine instruction level.