http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47061
Summary: VRP doesn't propagate through x<<=1, but it does for
x*=2
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
Created attachment 22850
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22850
testcase
The attached testcase should be optimised to "return 0;", as it is when
x <<= 1;
is replaced by
x *= 2;
$ gcc -O3 pr47061.c -fdump-tree-vrp -S -masm=intel
shows in the .vrp1/2 dumps (among others):
x_1: [-10, -9]
x_2: [-10, -8]
x_3: [-10, -7]
x_4: [-10, -6]
x_11: [-9, -8]
x_14: [-9, -7]
x_17: [-9, -6]
x_18: VARYING
...
<bb 10>:
# x_4 = PHI <x_3(8), x_17(9)>
x_18 = x_4 << 2;
Neither gcc version I tested works (3.3.6-4.6.0)