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
This commit is contained in:
parent
2038bd6935
commit
73f079427d
19
gcc/testsuite/gcc.dg/pack-test-5.c
Normal file
19
gcc/testsuite/gcc.dg/pack-test-5.c
Normal file
@ -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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user