Left shift of width 32, 33, 64, 65 etc produces inconsistencies.

const int j = 33;
printf("%d\n", 1 << j);
Output:
0

int j = 33;
printf("%d\n", 1 << j);
Output:
2

Same with C. Runtime shift instruction emmitted incorrectly.


-- 
           Summary: Left shift error
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: myprasanna at gmail dot com


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

Reply via email to