This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55137] New: [4.8 Regression] Unexpected static structure initialization
- From: "sebastian dot huber at embedded-brains dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Oct 2012 12:16:52 +0000
- Subject: [Bug c++/55137] New: [4.8 Regression] Unexpected static structure initialization
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55137
Bug #: 55137
Summary: [4.8 Regression] Unexpected static structure
initialization
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: sebastian.huber@embedded-brains.de
Created attachment 28573
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28573
Test case.
The test case:
struct S {
int a;
int b;
};
struct S s = {
sizeof(int),
(((1024 * 8) * 2) - (1024 * 8))
+ ((int)(((1024 * 8)) + (2 * sizeof(int)) + 8 - 1))
};
yields:
gcc -xc++ -g -c test.cc -o test.o && gdb test.o -ex "p s" -ex quit
[...]
$1 = {a = 0, b = 0}
Correct is (sizeof(int) == 4):
gcc -xc -g -c test.cc -o test.o && gdb test.o -ex "p s" -ex quit
[...]
$1 = {a = 4, b = 16399}