https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101187
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- To make sure we diagnose it and catch it in ubsan and FE constant expression folding. The folding of the shift count into constant can happen almost any time during the optimizations. For ubsan and FE constant expression folding likely all that is needed is that it is in match.pd GIMPLE only, because constexpr evaluation can use match.pd folding and ubsan shifts are instrumented in the FEs, but for the diagnostics not.