re PR target/23071 (Darwin alignment ignores "attribute packed" for first 'double' element of a struct)
PR target/23071 * config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align): Don't overly align based upon packed packed fields. From-SVN: r157654
This commit is contained in:
parent
cc72bbaac7
commit
212066e660
@ -1,3 +1,9 @@
|
||||
2010-03-22 Mike Stump <mikestump@comcast.net>
|
||||
|
||||
PR target/23071
|
||||
* config/rs6000/rs6000.c (darwin_rs6000_special_round_type_align):
|
||||
Don't overly align based upon packed packed fields.
|
||||
|
||||
2010-03-22 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* c-pretty-print.c (pp_c_specifier_qualifier_list) [VECTOR_TYPE]:
|
||||
|
@ -4653,6 +4653,9 @@ darwin_rs6000_special_round_type_align (tree type, unsigned int computed,
|
||||
field = TREE_CHAIN (field);
|
||||
if (! field)
|
||||
break;
|
||||
/* A packed field does not contribute any extra alignment. */
|
||||
if (DECL_PACKED (field))
|
||||
return align;
|
||||
type = TREE_TYPE (field);
|
||||
while (TREE_CODE (type) == ARRAY_TYPE)
|
||||
type = TREE_TYPE (type);
|
||||
|
14
gcc/testsuite/gcc.target/powerpc/darwin-abi-12.c
Normal file
14
gcc/testsuite/gcc.target/powerpc/darwin-abi-12.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* { dg-do compile { target powerpc*-*-darwin* } } */
|
||||
/* { dg-final { scan-assembler ".comm _x,12,2" } } */
|
||||
/* { dg-final { scan-assembler-not ".space 7" } } */
|
||||
/* PR 23071 */
|
||||
|
||||
struct Test {
|
||||
double D __attribute__((packed,aligned(4)));
|
||||
short X;
|
||||
} x;
|
||||
|
||||
struct {
|
||||
char x;
|
||||
struct Test t;
|
||||
} b = { 1, { 2, 3 } };
|
Loading…
Reference in New Issue
Block a user