aboutsummaryrefslogtreecommitdiff
path: root/gcc/multiple_target.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-05-16 15:08:48 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-05-16 13:08:48 +0000
commita61b003fbd290846feb08b6bf89bc5cf54fd87c3 (patch)
tree7cdde37690d5fb9388f37c132676bfe08419e29e /gcc/multiple_target.c
parent74a96dd28c997a55344c201baeed409e9e4ce7af (diff)
downloadgcc-a61b003fbd290846feb08b6bf89bc5cf54fd87c3.zip
gcc-a61b003fbd290846feb08b6bf89bc5cf54fd87c3.tar.gz
gcc-a61b003fbd290846feb08b6bf89bc5cf54fd87c3.tar.bz2
Do not allow target_clones with alias attr (PR lto/90500).
2019-05-16 Martin Liska <mliska@suse.cz> PR lto/90500 * multiple_target.c (expand_target_clones): Do not allow target_clones being used with a symbol that is an alias. 2019-05-16 Martin Liska <mliska@suse.cz> PR lto/90500 * gcc.target/i386/pr90500-1.c: New test. * gcc.target/i386/pr90500-2.c: New test. From-SVN: r271289
Diffstat (limited to 'gcc/multiple_target.c')
-rw-r--r--gcc/multiple_target.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c
index 0a87241..fa194d4 100644
--- a/gcc/multiple_target.c
+++ b/gcc/multiple_target.c
@@ -356,7 +356,7 @@ expand_target_clones (struct cgraph_node *node, bool definition)
}
if (node->definition
- && !tree_versionable_function_p (node->decl))
+ && (node->alias || !tree_versionable_function_p (node->decl)))
{
auto_diagnostic_group d;
error_at (DECL_SOURCE_LOCATION (node->decl),
@@ -365,6 +365,9 @@ expand_target_clones (struct cgraph_node *node, bool definition)
if (lookup_attribute ("noclone", DECL_ATTRIBUTES (node->decl)))
reason = G_("function %q+F can never be copied "
"because it has %<noclone%> attribute");
+ else if (node->alias)
+ reason
+ = "%<target_clones%> cannot be combined with %<alias%> attribute";
else
reason = copy_forbidden (DECL_STRUCT_FUNCTION (node->decl));
if (reason)