aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-04-26 17:23:10 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-04-26 17:23:10 -0400
commita89ca5c67eea6e16f22b4325be029484ab8ebcc2 (patch)
tree8247a46502c75f726dbffdd10d4a72c04709748c /gcc/c-common.c
parenta0053f2b87a6bd8d8b2742e75719118dfd31f516 (diff)
downloadgcc-a89ca5c67eea6e16f22b4325be029484ab8ebcc2.zip
gcc-a89ca5c67eea6e16f22b4325be029484ab8ebcc2.tar.gz
gcc-a89ca5c67eea6e16f22b4325be029484ab8ebcc2.tar.bz2
(init_attributes): Don't require decl for A_PACKED.
(decl_attributes, case A_PACKED): Set TYPE_PACKED for type. From-SVN: r9485
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 18d6265..474586e 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -246,7 +246,7 @@ add_attribute (id, string, min_len, max_len, decl_req)
static void
init_attributes ()
{
- add_attribute (A_PACKED, "packed", 0, 0, 1);
+ add_attribute (A_PACKED, "packed", 0, 0, 0);
add_attribute (A_NOCOMMON, "nocommon", 0, 0, 1);
add_attribute (A_NORETURN, "noreturn", 0, 0, 1);
add_attribute (A_NORETURN, "volatile", 0, 0, 1);
@@ -325,7 +325,9 @@ decl_attributes (node, attributes, prefix_attributes)
switch (id)
{
case A_PACKED:
- if (TREE_CODE (decl) == FIELD_DECL)
+ if (decl == 0)
+ TYPE_PACKED (type) = 1;
+ else if (TREE_CODE (decl) == FIELD_DECL)
DECL_PACKED (decl) = 1;
/* We can't set DECL_PACKED for a VAR_DECL, because the bit is
used for DECL_REGISTER. It wouldn't mean anything anyway. */