This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/52134] Does not fold (x * 4) & -4
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 13 Mar 2012 22:08:12 +0000
- Subject: [Bug middle-end/52134] Does not fold (x * 4) & -4
- Auto-submitted: auto-generated
- References: <bug-52134-4@http.gcc.gnu.org/bugzilla/>
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.