https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114700
Xi Ruoyao <xry111 at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Front-end optimization |Front-end optimization |generates wrong code with |generates wrong code with |-ftrapv. |-fsanitize=undefined CC| |xry111 at gcc dot gnu.org --- Comment #10 from Xi Ruoyao <xry111 at gcc dot gnu.org> --- (In reply to Richard Biener from comment #9) > That that GCC doesn't promise that -ftrapv preserves all overflows and > traps, it merely guarantees that all overflows that actually happen trap. > So GCC is fine to contract some expressions where the overall number of > overflows can only > decrease. > > That's not a bug with -ftrapv. > > It is considered a bug with -fsanitize=undefined though. So modifying the subject.