https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108937
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #5 from anlauf at gcc dot gnu.org --- Interestingly, we simplify IBITS(-1,0,32) to -1, and also the code generated for ibits(x, p, lbits) produces the result expected by the reporter, and which is also generated by Intel and NAG. For ISHFT we have /* ISHFT (I, SHIFT) = (abs (shift) >= BIT_SIZE (i)) ? 0 : ((shift >= 0) ? i << shift : i >> -shift) where all shifts are logical shifts. */ so we might as well consider doing what the reporter suggests.