[Bug c++/55137] New: [4.8 Regression] Unexpected static structure initialization
sebastian.huber@embedded-brains.de
gcc-bugzilla@gcc.gnu.org
Tue Oct 30 12:17:00 GMT 2012
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}
More information about the Gcc-bugs
mailing list