Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1134)

Unified Diff: gcc/c-family/c-common.c

Issue 5752064: User directed Function Multiversioning via Function Overloading Base URL: svn+ssh://gcc.gnu.org/svn/gcc/trunk/gcc/
Patch Set: User directed Function Multiversioning via Function Overloading Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gcc/cgraph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/c-family/c-common.c
===================================================================
--- gcc/c-family/c-common.c (revision 190493)
+++ gcc/c-family/c-common.c (working copy)
@@ -8502,9 +8502,22 @@ handle_target_attribute (tree *node, tree name, tr
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
}
- else if (! targetm.target_option.valid_attribute_p (*node, name, args,
- flags))
- *no_add_attrs = true;
+ else
+ {
+ /* When a target attribute is invalid, it may also be because the
+ target for the compilation unit and the attribute match. For
+ instance, target attribute "xxx" is invalid when -mxxx is used.
+ When used with multiversioning, removing the attribute will lead
+ to duplicate definitions if a default version is provided.
+ So, generate a warning here and remove the attribute. */
+ if (!targetm.target_option.valid_attribute_p (*node, name, args, flags))
+ {
+ warning (OPT_Wattributes,
+ "Invalid target attribute in function %qE, ignored.",
+ *node);
+ *no_add_attrs = true;
+ }
+ }
return NULL_TREE;
}
« no previous file with comments | « no previous file | gcc/cgraph.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b