[Bug tree-optimization/122209] reassoc? with bit masking
rdapp at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 29 12:31:48 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122209
--- Comment #3 from Robin Dapp <rdapp at gcc dot gnu.org> ---
Some more context here. What _does_ work is
t = 3 + 4 * t;
t &= 0xFFF;
t = 3 + 4 * t;
t &= 0xFFF;
...
ccp is able to recognize exactly what we want and optimize to
return 4095;
So IMHO it is a reassoc (or related) problem. I'll play around with that
in the next stage 1.
More information about the Gcc-bugs
mailing list