aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-attribs.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-02-28 13:27:22 +0100
committerMartin Liska <mliska@suse.cz>2022-03-01 10:10:29 +0100
commit6df0c8d417fb33ea130e2957755a60483e9fd692 (patch)
tree0a9cf70f1d60f30e262cbae094ffacfe38955ba4 /gcc/c-family/c-attribs.cc
parentb88f683e57acb06593959c26c9d78861fcd15cf1 (diff)
downloadgcc-6df0c8d417fb33ea130e2957755a60483e9fd692.zip
gcc-6df0c8d417fb33ea130e2957755a60483e9fd692.tar.gz
gcc-6df0c8d417fb33ea130e2957755a60483e9fd692.tar.bz2
ipa: Improve error handling for target_clone single value
PR ipa/104533 gcc/c-family/ChangeLog: * c-attribs.cc (handle_target_clones_attribute): Use get_target_clone_attr_len and report warning soon. gcc/ChangeLog: * multiple_target.cc (get_attr_len): Move to tree.c. (expand_target_clones): Remove single value checking. * tree.cc (get_target_clone_attr_len): New fn. * tree.h (get_target_clone_attr_len): Likewise. gcc/testsuite/ChangeLog: * g++.target/i386/pr104533.C: New test.
Diffstat (limited to 'gcc/c-family/c-attribs.cc')
-rw-r--r--gcc/c-family/c-attribs.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/c-family/c-attribs.cc b/gcc/c-family/c-attribs.cc
index 3849dba..d394ea9 100644
--- a/gcc/c-family/c-attribs.cc
+++ b/gcc/c-family/c-attribs.cc
@@ -5486,6 +5486,12 @@ handle_target_clones_attribute (tree *node, tree name, tree ARG_UNUSED (args),
"with %qs attribute", name, "target");
*no_add_attrs = true;
}
+ else if (get_target_clone_attr_len (args) == -1)
+ {
+ warning (OPT_Wattributes,
+ "single %<target_clones%> attribute is ignored");
+ *no_add_attrs = true;
+ }
else
/* Do not inline functions with multiple clone targets. */
DECL_UNINLINABLE (*node) = 1;