Commit a89ca5c6 by Richard Kenner

(init_attributes): Don't require decl for A_PACKED.

(decl_attributes, case A_PACKED): Set TYPE_PACKED for type.

From-SVN: r9485
parent a0053f2b
...@@ -246,7 +246,7 @@ add_attribute (id, string, min_len, max_len, decl_req) ...@@ -246,7 +246,7 @@ add_attribute (id, string, min_len, max_len, decl_req)
static void static void
init_attributes () 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_NOCOMMON, "nocommon", 0, 0, 1);
add_attribute (A_NORETURN, "noreturn", 0, 0, 1); add_attribute (A_NORETURN, "noreturn", 0, 0, 1);
add_attribute (A_NORETURN, "volatile", 0, 0, 1); add_attribute (A_NORETURN, "volatile", 0, 0, 1);
...@@ -325,7 +325,9 @@ decl_attributes (node, attributes, prefix_attributes) ...@@ -325,7 +325,9 @@ decl_attributes (node, attributes, prefix_attributes)
switch (id) switch (id)
{ {
case A_PACKED: 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; DECL_PACKED (decl) = 1;
/* We can't set DECL_PACKED for a VAR_DECL, because the bit is /* We can't set DECL_PACKED for a VAR_DECL, because the bit is
used for DECL_REGISTER. It wouldn't mean anything anyway. */ used for DECL_REGISTER. It wouldn't mean anything anyway. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment