https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114429
--- Comment #2 from Hongtao Liu <liuhongt at gcc dot gnu.org> --- (In reply to Hongtao Liu from comment #1) > when x is INT_MIN, I assume -x is UD, so compiler can do anything. > otherwise, (-x) >> 31 is just x > 0. > From rtl view. neg of INT_MIN is assumed to 0 after it's truncated. Wait, is -INT_MIN truncated to INT_MIN? if that's case, we can't do the optimization at rtl.