summaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-08 01:10:40 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2000-12-08 01:10:40 +0000
commit0c9b3e1f1ac6fe7e450ba5e846cf8ec815961d30 (patch)
treeee1135791694b818e99a4db9289fb784e53dd06c /gcc/c-decl.c
parentc2861d8e10eddd2d3f52e46b6a3ca2d4bd47d966 (diff)
downloadgcc-0c9b3e1f1ac6fe7e450ba5e846cf8ec815961d30.tar.gz
* c-decl.c (grokdeclarator): preserve previous alignments when
rebuilding array types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38122 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 4776cd693d0..f10f4b02b6a 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