[Bug middle-end/52134] Does not fold (x * 4) & -4
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 6 19:46:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52134
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |TREE
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-06 19:45:41 UTC ---
Short testcase:
unsigned f(unsigned t)
{
return (t*4)&-4;
}
int f1(int t)
{
return (t*4)&-4;
}
Both should be optimized to just t*4. In fact we do it on the RTL level.
*4 is changed to <<a 2 on the RTL level and simplified with the & when doing
combine.
More information about the Gcc-bugs
mailing list