This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/30332] New: bit-field: optimization BUG?


The output is different by the optimization.

testcase:
#include <stdio.h>

struct S
{
  unsigned int long long a:33;
};


int main ()
{
  struct S x = { -1 };
  typeof(+x.a) z = x.a+10;
  printf("%llx\n", z);

  return 0;
}

result:
$ g++ bug.cpp; ./a
200000009

$ g++ -O bug.cpp; ./a
9

gcc version: 4.2 20061212


-- 
           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=30332


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]