The output is different by the optimization.

testcase:
#include <stdio.h>

struct foo
{
  unsigned long long b:33;
};


int main()
{
  struct foo x = {2};
  printf("%llx\n",(x.b<<32));
  return 0;
}

result:
$ gcc bit.c -o bit; ./bit
200000000

$ gcc -O bit.c -o bit; ./bit
0


-- 
           Summary: bit-field: optimization BUG
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: s__nakayama at infoseek dot jp


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

Reply via email to