* gcc.dg/compat/struct-layout-1_generate.c (generate_fields):
authorsje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2005 17:34:18 +0000 (17:34 +0000)
committersje <sje@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 7 Oct 2005 17:34:18 +0000 (17:34 +0000)
Do not put aligned attributes on array elements.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@105094 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/compat/struct-layout-1_generate.c

index 44e8a7a..47bd2f9 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-07  Steve Ellcey  <sje@cup.hp.com>
+
+       * gcc.dg/compat/struct-layout-1_generate.c (generate_fields):
+       Do not put aligned attributes on array elements.
+
 2005-10-07  Ulrich Weigand  <uweigand@de.ibm.com>
 
        PR testsuite/23611, PR testsuite/23615
index b3d6ece..5519cf9 100644 (file)
@@ -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;
        }
     }
 }