aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorSriraman Tallam <tmsriram@google.com>2012-12-27 01:58:06 +0000
committerSriraman Tallam <tmsriram@google.com>2012-12-27 01:58:06 +0000
commitf860c34bc6d6844b019d5b079a8271ad6dbe85d7 (patch)
tree6ecc2e00fdb5157210f90bdc5849eedd4a227257 /gcc/c-family
parent5c5a5e63665d92edf7d822e67dd97816ac247758 (diff)
Before this patch, function multiversioning determines that two functions
are different by comparing the arch type and isa flags that are set after the target string is processed. This leads to cases where the versions become identical when the command-line target options are altered. This patch modifies the function version determination to just compare the target string. 2012-12-27 Sriraman Tallam <tmsriram@google.com> * doc/tm.texi.in (TARGET_OPTION_SUPPORTS_FUNCTION_VERSIONS): Document new target hook. * doc/tm.texi: Regenerate. * c-family/c-common.c (handle_target_attribute): Retain target attribute for targets that support versioning. * target.def (supports_function_versions): New hook. * cp/class.c (add_method): Remove calls to DECL_FUNCTION_SPECIFIC_TARGET. * config/i386/i386.c (ix86_function_versions): Use target string to check for function versions instead of target flags. * (ix86_supports_function_versions): New function. * (is_function_default_version): Check target string. * TARGET_OPTION_SUPPORTS_FUNCTION_VERSIONS: New macro. 2012-12-27 Sriraman Tallam <tmsriram@google.com> * testsuite/g++.dg/mv1.C: Remove target options. * testsuite/g++.dg/mv2.C: Ditto. * testsuite/g++.dg/mv3.C: Ditto. * testsuite/g++.dg/mv4.C: Ditto. * testsuite/g++.dg/mv5.C: Ditto. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@194730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/c-common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 872a6a0feed..012751330f3 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -8742,8 +8742,12 @@ handle_target_attribute (tree *node, tree name, tree args, int flags,
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
}
+ /* Do not strip invalid target attributes for targets which support function
+ multiversioning as the target string is used to determine versioned
+ functions. */
else if (! targetm.target_option.valid_attribute_p (*node, name, args,
- flags))
+ flags)
+ && ! targetm.target_option.supports_function_versions ())
*no_add_attrs = true;
return NULL_TREE;