[Bug tree-optimization/122209] reassoc? with bit masking

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 8 19:34:11 GMT 2025


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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is also not handled at the gimple level either:
```
int
foo (unsigned _BitInt(12) t)
{
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
t += 3wb + 3wb * t;
return t;
}
```

(basically the same thing except with _BitInt to do the &0xFFF (mod 1<<12)).


More information about the Gcc-bugs mailing list