http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47061

--- Comment #2 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-24 19:25:21 
UTC ---
(In reply to comment #1)
> For the right shift, the
> function is optimised correctly.

Actually, no, it's just the cast what optimises the range, but not the shift -
.vrp1 dump for "int i = c >> 1;":
...
c_1(D): VARYING
D.2684_2: VARYING
i_3: [-128, 127]
D.2685_4: [0, 0]
...
<bb 2>:
  D.2684_2 = c_1(D) >> 1;
  i_3 = (int) D.2684_2;
  D.2685_4 = 0;
  return 0;
...

Reply via email to