]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-decl.c (grokdeclarator): preserve previous alignments when rebuilding array types.
authorDJ Delorie <dj@redhat.com>
Fri, 8 Dec 2000 01:10:40 +0000 (20:10 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Fri, 8 Dec 2000 01:10:40 +0000 (20:10 -0500)
* c-decl.c (grokdeclarator): preserve previous alignments when
rebuilding array types.

From-SVN: r38122

gcc/ChangeLog
gcc/c-decl.c

index 407baf1ed030a345078e62a1dc6cb6069ca8140a..b569533e7b384b287c711156404ea0a064542a0b 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-07  DJ Delorie  <dj@redhat.com>
+
+       * c-decl.c (grokdeclarator): preserve previous alignments when
+       rebuilding array types.
+
 2000-12-07  Neil Booth  <neilb@earthling.net>
 
         * cppfiles.c (struct include_file): Move from cpphash.h.
index 4776cd693d0bce8136c6f30e122986181a915b9d..f10f4b02b6a211037bd0a03c6651d8b1c5cfc125 100644 (file)
@@ -4902,9 +4902,11 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
        /* Move type qualifiers down to element of an array.  */
        if (TREE_CODE (type) == ARRAY_TYPE && type_quals)
          {
+           int saved_align = TYPE_ALIGN(type);
            type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
                                                             type_quals),
                                     TYPE_DOMAIN (type));
+           TYPE_ALIGN (type) = saved_align;
 #if 0 /* Leave the variable const or volatile as well.  */
            type_quals = TYPE_UNQUALIFIED;
 #endif