https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101434
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- So technically (int)short-var << a -> short-var << (min (a, 15)) we know a is <= 31 because of the int shift (and >= 0) but we cannot simply emit short-var << a because how the target behaves is not well-defined (SHIFT_COUNT_TRUNCATED) but the behavior is well-defined for the int << int shift. Pattern recog has code to deal with this in theory but it gives up here and does not bother to emit a min ().