aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>1998-07-17 03:34:34 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>1998-07-17 03:34:34 +0000
commitf022f9bcfc83be98e0c6618354a0fc3f9b4df0de (patch)
tree6f364e634f23a7fc189f0f63588df159f8f084e8 /gcc
parent03d8299153268472d5a2f25a05ca4aebde890ef9 (diff)
downloadgcc-f022f9bcfc83be98e0c6618354a0fc3f9b4df0de.zip
gcc-f022f9bcfc83be98e0c6618354a0fc3f9b4df0de.tar.gz
gcc-f022f9bcfc83be98e0c6618354a0fc3f9b4df0de.tar.bz2
tree.c (valid_machine_attribute): Only create a new type variant if there is a decl to use it.
* tree.c (valid_machine_attribute): Only create a new type variant if there is a decl to use it. From-SVN: r21247
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a6e5fd6..90b8773 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jul 17 03:26:12 1998 Rihcard Earnshaw (rearnsha@arm.com)
+
+ * tree.c (valid_machine_attribute): Only create a new type variant if
+ there is a decl to use it.
+
Thu Jul 16 14:48:04 1998 Nick Clifton <nickc@cygnus.com>
* gcc.c (do_spec_1): Cope with %g/%u/%U options which do not have
diff --git a/gcc/tree.c b/gcc/tree.c
index ec42643..b02e87e 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -3391,8 +3391,14 @@ valid_machine_attribute (attr_name, attr_args, decl, type)
}
else
{
+ /* If this is part of a declaration, create a type variant,
+ otherwise, this is part of a type definition, so add it
+ to the base type. */
type_attr_list = tree_cons (attr_name, attr_args, type_attr_list);
- type = build_type_attribute_variant (type, type_attr_list);
+ if (decl != 0)
+ type = build_type_attribute_variant (type, type_attr_list);
+ else
+ TYPE_ATTRIBUTES (type) = type_attr_list;
}
if (decl != 0)
TREE_TYPE (decl) = type;