This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/24462] [4.1/4.2 Regression] packed-aligned structures are laid out differently
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Dec 2005 12:32:04 -0000
- Subject: [Bug middle-end/24462] [4.1/4.2 Regression] packed-aligned structures are laid out differently
- References: <bug-24462-226@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from jakub at gcc dot gnu dot org 2005-12-29 12:32 -------
Is this still a problem?
I certainly can't reproduce this on sparc*-linux:
struct B1_m_outer_p_inner {
char c;
double d;
} __attribute__ ((aligned)) __attribute__ ((packed)) s;
extern void abort (void);
int main ()
{
char *p, *q;
if (sizeof (struct B1_m_outer_p_inner) != 16 || __alignof__ (struct
B1_m_outer_p_inner) != 8
|| sizeof (s) != 16 || __alignof__ (s) != 8
|| __alignof__ (s.c) != 1
|| __alignof__ (s.d) != 1)
abort ();
p = &s.c;
q = (char *) &s.d;
if (q - p != 1)
abort ();
return 0;
}
succeeds with both GCC 3.4.x and current trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24462