aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatherine Moore <clm@cygnus.com>2000-06-30 14:59:10 +0000
committerCatherine Moore <clm@gcc.gnu.org>2000-06-30 10:59:10 -0400
commitaf80d489916e279bdb3f75ca458b1d323205120f (patch)
tree5aa7aabc6aacc1c95c5c9e619592779177403ca1
parent45f640c2f187daa6d0da92772ee356d4b770421c (diff)
downloadgcc-af80d489916e279bdb3f75ca458b1d323205120f.zip
gcc-af80d489916e279bdb3f75ca458b1d323205120f.tar.gz
gcc-af80d489916e279bdb3f75ca458b1d323205120f.tar.bz2
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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-common.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3ee3b40..4901baf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-30 Catherine Moore <clm@cygnus.com>
+
+ * c-common.c (decl_attributes): Differentiate between
+ types and type decls for alignment.
+
2000-06-30 Nathan Sidwell <nathan@codesourcery.com>
* cpp.texi: Document #pragma GCC dependency
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 5fffa79..dafa33e 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)