aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-03-16 17:24:31 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1995-03-16 17:24:31 -0500
commitd3e0f18932563d067a7a35555d94313f1d675ce6 (patch)
tree6ebefed985776d922c08da5e5a06542e1304cef9 /gcc/c-common.c
parentce133c0fae02985fc9f50953b88d596cc66723b4 (diff)
downloadgcc-d3e0f18932563d067a7a35555d94313f1d675ce6.zip
gcc-d3e0f18932563d067a7a35555d94313f1d675ce6.tar.gz
gcc-d3e0f18932563d067a7a35555d94313f1d675ce6.tar.bz2
(decl_attributes): Allow alignment for TYPE_DECLs.
From-SVN: r9195
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 49bafc9..d1fdc6a 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -393,10 +393,12 @@ decl_attributes (decl, attributes, prefix_attributes)
if (exact_log2 (align) == -1)
error_with_decl (decl,
"requested alignment of `%s' is not a power of 2");
+ else if (TREE_CODE (decl) == TYPE_DECL)
+ TYPE_ALIGN (TREE_TYPE (decl)) = align;
else if (TREE_CODE (decl) != VAR_DECL
&& TREE_CODE (decl) != FIELD_DECL)
error_with_decl (decl,
- "alignment specified for `%s'");
+ "alignment may not be specified for `%s'");
else
DECL_ALIGN (decl) = align;
}