https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69845
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Component|tree-optimization |middle-end --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The problem is in fold: In .003t.original: int B = A + 27685516; int C = B * 1067204616(OVF) + -887971669(OVF); The reason why it works with -fwrapv is because GCC does not transform: C = B * 1067204616(OVF) + -887971669(OVF) C != 1676211843 Into false because first it does it into: B*0x3f9c4008 != 0x6729aa28 And then notices 0x3f9c4008 is not a factor of 0x6729aa28.