https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125811 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- But a * (1<<b) and a << b have different sets of UB (left shift of negative value). Watch out for wrong-code and missed UBSAN.