[Bug middle-end/52134] Does not fold (x * 4) & -4
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Mar 13 22:12:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52134
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-13 22:08:12 UTC ---
CCP could also remove the &:
Visiting statement:
D.1713_2 = t_1(D) * 4;
which is likely CONSTANT
Lattice value changed to CONSTANT Lattice value changed to CONSTANT
0x00000000000000000 (0x000000000fffffffc). Adding SSA edges to worklist.
Visiting statement:
D.1712_3 = D.1713_2 & 4294967292;
which is likely CONSTANT
Lattice value changed to CONSTANT Lattice value changed to CONSTANT
0x00000000000000000 (0x000000000fffffffc). Adding SSA edges to worklist.
..
Visiting statement:
D.1710_2 = t_1(D) * 4;
which is likely CONSTANT
Lattice value changed to CONSTANT Lattice value changed to CONSTANT
0x00000000000000000 (0xfffffffffffffffffffffffffffffffc). Adding SSA edges to
worklist.
Visiting statement:
D.1709_3 = D.1710_2 & -4;
which is likely CONSTANT
Lattice value changed to CONSTANT Lattice value changed to CONSTANT
0x00000000000000000 (0xfffffffffffffffffffffffffffffffc). Adding SSA edges to
worklist.
See how the lattice's already have its last 3 bits unset. In fact I think we
should only do this in the ccp/vrp passes to remove the & rather than fold.
More information about the Gcc-bugs
mailing list