struct-layout-1_generate.c (generate_fields): Do not put aligned attributes on array...
authorSteve Ellcey <sje@cup.hp.com>
Fri, 7 Oct 2005 17:34:18 +0000 (17:34 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Fri, 7 Oct 2005 17:34:18 +0000 (17:34 +0000)
* gcc.dg/compat/struct-layout-1_generate.c (generate_fields):
Do not put aligned attributes on array elements.

From-SVN: r105094

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

index 44e8a7a5436b1a999335e0b6c39874cb8f485b17..47bd2f90f7a3224e92d590784a749804056d59e2 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 b3d6ece54edb5c634c655875e0d7661b87fe76d7..5519cf9d03f31278bc370b4e05b820b516fb3ee7 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;
        }
     }
 }