https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98907
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- What LLVM does is the following: ((x >> 31) | 1) * x; Convert (x >> 31) into -(x < 0) (-(x < 0)) | -> x < 0 ? -1 : 1 (x < 0 ? -1 : 1) *x -> x < 0 ? -x : x Now we could do the same I don't know to do this way or another way.