https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119690
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think this is ivopts bug (or at least that pass introduces UB into the IL that wasn't there before). In particular on the c <= 0 guarded edge it adds <bb 8> [local count: 105119324]: + _26 = b.1_13 + -2147483648; + _1 = (unsigned int) _26; + _8 = (unsigned int) _14; + ivtmp.17_11 = _8 + 2147483648; where b.1_13 at runtime is -2147483647 and both b.1_13 and _26 have int type. So, the addition invokes UB. Given that previously all that was there was (a + b) + 2147483647, nothing was known about b's range, only about a + b, so I think it certainly should have been unsigned _26: _26 = (unsigned int) b.1_13; _1 = _26 + 2147483648;