summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-26 21:23:10 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-26 21:23:10 +0000
commitcf3333384a3e138170ec3768b1263ec20ce2f53f (patch)
tree8247a46502c75f726dbffdd10d4a72c04709748c /gcc/c-common.c
parent91d08bbba9408f8163177a2f7dcf2995f26385ac (diff)
downloadgcc-cf3333384a3e138170ec3768b1263ec20ce2f53f.tar.gz
(init_attributes): Don't require decl for A_PACKED.
(decl_attributes, case A_PACKED): Set TYPE_PACKED for type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9485 138bc75d-0d04-0410-961f-82ee72b054a4
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 18d6265b710..474586ec81d 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. */