This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30332] New: bit-field: optimization BUG?
- 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: 30 Dec 2006 08:21:39 -0000
- Subject: [Bug c++/30332] New: bit-field: optimization BUG?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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