From 79a1aca79799abe989b78a732148f29767af29dc Mon Sep 17 00:00:00 2001 From: Steve Ellcey Date: Fri, 7 Oct 2005 17:34:18 +0000 Subject: [PATCH] struct-layout-1_generate.c (generate_fields): Do not put aligned attributes on array elements. * gcc.dg/compat/struct-layout-1_generate.c (generate_fields): Do not put aligned attributes on array elements. From-SVN: r105094 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 44e8a7a..47bd2f9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-10-07 Steve Ellcey + + * gcc.dg/compat/struct-layout-1_generate.c (generate_fields): + Do not put aligned attributes on array elements. + 2005-10-07 Ulrich Weigand PR testsuite/23611, PR testsuite/23615 diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c index b3d6ece..5519cf9 100644 --- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c +++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c @@ -1743,6 +1743,14 @@ generate_fields (enum FEATURE features, struct entry *e, struct entry *parent, || (e[n].type >= &aligned_bitfld_types[0] && e[n].type < &aligned_bitfld_types[n_aligned_bitfld_types]))) e[n].attrib = NULL; + + /* If this is an array type, do not put aligned attributes on + elements. Aligning elements to a value greater than their + size will result in a compiler error. */ + + if ((e[n].etype == ETYPE_ARRAY) + && (strncmp (e[n].attrib, "atal", 4) == 0)) + e[n].attrib = NULL; } } } -- 2.7.4