From: Richard Earnshaw Date: Fri, 17 Jul 1998 03:32:36 +0000 (+0000) Subject: tree.c (valid_machine_attribute): Only create a new type variant if there is a decl... X-Git-Tag: prereleases/egcs-1.1-prerelease~211 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87c2129050bc7b2050857935665b9a2f581c1fc8;p=thirdparty%2Fgcc.git 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: r21246 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 40ebcc6d5254..360fa628dbd0 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. + Fri Jul 17 02:01:00 1998 Jeffrey A Law (law@cygnus.com) * Makefile.in (WARN_CFLAGS): Disable -W -Wall for the release diff --git a/gcc/tree.c b/gcc/tree.c index ec42643f333e..b02e87e8af45 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;