https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103887
--- Comment #2 from Michal Kubecek <m...@mk-sys.cz> --- (In reply to Andrew Pinski from comment #1) > The problem is rather __builtin_constant_p not resolving to a constant. This > is a dup of bug 79482. There is a difference: your modified testcase fails to compile regardless of -fsanitize=shift while mine fails only with this option and succeeds without it. If __builtin_constant_p(tr) not being handled as constant were the problem, the result should not depend on presence of "-fsanitize=shift".