diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2003-10-20 18:01:58 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-10-20 18:01:58 -0400 |
commit | 73f079427dd45f8731a9b064932cf8f7cea7d311 (patch) | |
tree | 99702060f929b5c08f13fc9befcb764c656bce2e /gcc | |
parent | 2038bd6935ac0e660517b1e2bb17f8482210b3fb (diff) | |
download | gcc-73f079427dd45f8731a9b064932cf8f7cea7d311.zip gcc-73f079427dd45f8731a9b064932cf8f7cea7d311.tar.gz gcc-73f079427dd45f8731a9b064932cf8f7cea7d311.tar.bz2 |
re PR c/11446 ([3.4][3.4 regression?] Incompatibilty with alignment of structures between 3.3 and 3.4 CVS)
PR c/11446
* stor-layout.c (layout_decl): Fix alignment handling.
From-SVN: r72725
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/gcc.dg/pack-test-5.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pack-test-5.c b/gcc/testsuite/gcc.dg/pack-test-5.c new file mode 100644 index 0000000..e95030c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pack-test-5.c @@ -0,0 +1,19 @@ +/* PR c/11446: packed on a struct takes precedence over aligned on the type + of a field. */ +/* { dg-do run } */ + +struct A { + double d; +} __attribute__ ((aligned)); + +struct B { + char c; + struct A a; +} __attribute__ ((packed)); + +int main () +{ + if (sizeof (struct B) != sizeof (char) + sizeof (struct A)) + abort (); + return 0; +} |