From af80d489916e279bdb3f75ca458b1d323205120f Mon Sep 17 00:00:00 2001 From: Catherine Moore Date: Fri, 30 Jun 2000 14:59:10 +0000 Subject: [PATCH] c-common.c (decl_attributes): Differentiate between types and type decls for alignment. * c-common.c (decl_attributes): Differentiate between types and type decls for alignment. From-SVN: r34810 --- gcc/ChangeLog | 5 +++++ gcc/c-common.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ee3b4091ae..4901bafafbc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-06-30 Catherine Moore + + * c-common.c (decl_attributes): Differentiate between + types and type decls for alignment. + 2000-06-30 Nathan Sidwell * cpp.texi: Document #pragma GCC dependency diff --git a/gcc/c-common.c b/gcc/c-common.c index 5fffa79f41b..dafa33e5fca 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -779,8 +779,16 @@ decl_attributes (node, attributes, prefix_attributes) error ("requested alignment is too large"); else if (is_type) { - TYPE_ALIGN (type) = (1 << i) * BITS_PER_UNIT; - TYPE_USER_ALIGN (type) = 1; + if (decl) + { + DECL_ALIGN (decl) = (1 << i) * BITS_PER_UNIT; + DECL_USER_ALIGN (decl) = 1; + } + else + { + TYPE_ALIGN (type) = (1 << i) * BITS_PER_UNIT; + TYPE_USER_ALIGN (type) = 1; + } } else if (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FIELD_DECL) -- 2.30.2