https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93184
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Wojciech Migda from comment #2) > Should there be at least a warning in case when the shift amount is a > compile-time known constant? There is a warning, but only when it is a constant in the FEs, in your testcase it needs to be inlined first to turn it into a compile time constant. For that case, the only thing the compiler offers is the runtime instrumentation (compile/link with -fsanitize=undefined (etc.), you'll get runtime errors about it.