From 54d7f9aa04cdeb3676cd614d0d80aaab5e492b19 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 7 Dec 2000 20:10:40 -0500 Subject: [PATCH] c-decl.c (grokdeclarator): preserve previous alignments when rebuilding array types. * c-decl.c (grokdeclarator): preserve previous alignments when rebuilding array types. From-SVN: r38122 --- gcc/ChangeLog | 5 +++++ gcc/c-decl.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 407baf1..b569533 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-12-07 DJ Delorie + + * c-decl.c (grokdeclarator): preserve previous alignments when + rebuilding array types. + 2000-12-07 Neil Booth * cppfiles.c (struct include_file): Move from cpphash.h. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 4776cd6..f10f4b0 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -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 -- 2.7.4