This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/47061] VRP doesn't propagate through x<<=1, but it does for x*=2
- From: "zsojka at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 24 Dec 2010 15:54:37 +0000
- Subject: [Bug tree-optimization/47061] VRP doesn't propagate through x<<=1, but it does for x*=2
- Auto-submitted: auto-generated
- References: <bug-47061-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47061
--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-24 15:54:35 UTC ---
Created attachment 22851
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22851
another testcase
This testcase seems to be optimised at the RTL level.
$ gcc pr47061-2.c -S -O3 -fdump-tree-vrp
.vrp1/2 dumps show:
...
c_1(D): VARYING
D.2684_2: [-128, 127]
i_3: VARYING
D.2685_4: [0, 1]
...
<bb 2>:
D.2684_2 = (int) c_1(D);
i_3 = D.2684_2 << 1;
D.2685_4 = i_3 > 1000;
return D.2685_4;
...
So the value is known before the shift as well. For the right shift, the
function is optimised correctly.