From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Clements To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c/4104: structure misalignment problem causing kernel failures Date: Mon, 15 Oct 2001 07:56:00 -0000 Message-id: <20011015145602.11687.qmail@sourceware.cygnus.com> X-SW-Source: 2001-10/msg00309.html List-Id: The following reply was made to PR c/4104; it has been noted by GNATS. From: Paul Clements To: rodrigc@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org Subject: Re: c/4104: structure misalignment problem causing kernel failures Date: Mon, 15 Oct 2001 09:29:06 -0400 rodrigc@gcc.gnu.org wrote: > > Synopsis: structure misalignment problem causing kernel failures > > State-Changed-From-To: open->feedback > State-Changed-By: rodrigc > State-Changed-When: Sat Oct 13 20:52:01 2001 > State-Changed-Why: > Please review the bug submission guidelines at > http://gcc.gnu.org/bugs.html and submit preprocessed source > with your bug report. > > Also, since you are using the Redhat version of gcc, > please report your bug to Red Hat's bug reporting > system at: > http://bugzilla.redhat.com/bugzilla/ > > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4104&database=gcc more info: ---------------------- Subject: [Bug 52451] Changed - structure misalignment problem in gcc 2.96-81 Date: Thu, 23 Aug 2001 16:59:12 -0400 From: bugzilla@redhat.com To: jakub@redhat.com, paul.clements@steeleye.com, dlt@redhat.com Please do not reply directly to this email. All additional comments should be made in the comments box of this bug report. https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=52451 --- shadow/52451 Thu Aug 23 16:37:00 2001 +++ shadow/52451.tmp.10269 Thu Aug 23 16:59:12 2001 @@ -3,7 +3,7 @@ Version: 7.1 Platform: i386 OS/Version: Linux -Status: NEEDINFO +Status: ASSIGNED Resolution: Severity: high Priority: normal @@ -139,3 +139,24 @@ Created an attachment (id=29274) pre-processed source file, which demonstrates misalignment problem + +------- Additional comments from jakub@redhat.com 2001-08-23 16:59:38 ------- +Simplified testcase +typedef struct x { int a; int b; } __attribute__((aligned(32))) X; +typedef struct y { X x[32]; int c; } Y; + +Y y[3]; + +int main(void) +{ + if (sizeof (y) != 3168) + abort (); + exit (0); +} +(the X in array is important, changing it to +typedef struct y { X x; X y[31]; int c; } Y; +fixes it). +This testcase works on gcc < 2.96-RH or on 2.96-RH+ (incl. 3.0, 3.0.1, 3.1) +on non-IA-32 architectures (tested alpha, IA-64, sparc). +Fails on IA-32 with 2.96-RH, 3.0, 3.0.1, 3.1. +Apparently some config/i386 alignment issue, will debug this tomorrow.