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++/26534] New: bitfield wrong optimize


#include <stdio.h>
struct X
{
  unsigned a:4;
};

int main()
{
  struct X x = { 63u };
  printf("%u\n", x.a);
  return 0;
}
// end.

result:
g++    bug.cpp; ./a 
15

g++ -O bug.cpp; ./a
63
wrong result!!


-- 
           Summary: bitfield wrong optimize
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: major
          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=26534


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