This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26534] New: bitfield wrong optimize
- From: "s__nakayama at infoseek dot jp" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Mar 2006 21:23:30 -0000
- Subject: [Bug c++/26534] New: bitfield wrong optimize
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#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