https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104357
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > One thing I should note: > _7 = x_3(D) >= 0; > _6 = (unsigned char) _7; > _8 = -_6; > > Should be done on the gimple level as: > t = x_3(D) >> (sizeof(x_3(D))*8 - 1) > _8 = (unsigned char)t; Actually it is: _2 = x_3(D) >> 31; _5 = ~_2; _8 = (unsigned char) _5;