https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100810
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- # i_16 = PHI <i_25(D)(21), i_17(9)> .... _22 = (unsigned int) i_16; _48 = -_22; _49 = _39 - _22; h_lsm.23_29 = (int) _49; Somehow or another h gets its value from i which causes the incorrect code. ccp is not at fault.