public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55137] New: [4.8 Regression] Unexpected static structure initialization
@ 2012-10-30 12:17 sebastian.huber@embedded-brains.de
  2012-10-30 12:56 ` [Bug c++/55137] " paolo.carlini at oracle dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2012-10-30 12:17 UTC (permalink / raw)
  To: gcc-bugs


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}


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-12-06 14:38 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30 12:17 [Bug c++/55137] New: [4.8 Regression] Unexpected static structure initialization sebastian.huber@embedded-brains.de
2012-10-30 12:56 ` [Bug c++/55137] " paolo.carlini at oracle dot com
2012-10-30 12:57 ` paolo.carlini at oracle dot com
2012-11-06 15:04 ` jakub at gcc dot gnu.org
2012-11-06 15:21 ` jakub at gcc dot gnu.org
2012-11-06 15:32 ` sebastian.huber@embedded-brains.de
2012-11-06 15:35 ` sebastian.huber@embedded-brains.de
2012-11-06 15:37 ` jakub at gcc dot gnu.org
2012-11-06 15:51 ` sebastian.huber@embedded-brains.de
2012-11-06 17:11 ` jakub at gcc dot gnu.org
2012-11-08 10:19 ` sebastian.huber@embedded-brains.de
2012-11-08 20:10 ` jason at gcc dot gnu.org
2012-11-08 20:17 ` jakub at gcc dot gnu.org
2012-11-22 14:42 ` jason at gcc dot gnu.org
2012-11-22 16:24 ` paolo.carlini at oracle dot com
2012-12-06 14:38 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).