[Bug tree-optimization/106884] ifcombine may move shift so it shifts more than bitwidth

kristerw at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Sep 8 10:53:16 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106884

--- Comment #2 from Krister Walfridsson <kristerw at gcc dot gnu.org> ---
This optimization is invalid if (int)1 << 33 is _not_ undefined behavior in
GIMPLE!

Consider an architecture where (int)1 << 33 evaluates to 0. foo(2, 1, 33)
evaluates to 0 for the original GIMPLE, but it evaluates to 2 in the optimized
IR.


More information about the Gcc-bugs mailing list