https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94892
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Two things we should simplify: _4 = _3 >> 31; _4 != -1 Into: _3 >= 0 (if _3 is signed, otherwise false) (this will solve f0) And: _4 = x_3(D) >> 31; _7 = -x_3(D); _8 = (unsigned int) _7; _9 = _8 >> 31; _10 = (int) _9; _11 = _4 | _10; Into: _4 = x_3(D) >> 31; // keep around _t = _4 | 1; _11 = x != 0 ? _t : 0;