Before this patch, function multiversioning determines that two functions
authortmsriram <tmsriram@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Dec 2012 01:58:06 +0000 (01:58 +0000)
committertmsriram <tmsriram@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 27 Dec 2012 01:58:06 +0000 (01:58 +0000)
commitc87676637f095c8232e0e100375aefa8f94cf911
tree6ecc2e00fdb5157210f90bdc5849eedd4a227257
parent4b5b792d796c400a31faee89eeeb2d6ac03b98b4
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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194730 138bc75d-0d04-0410-961f-82ee72b054a4
13 files changed:
gcc/ChangeLog
gcc/c-family/c-common.c
gcc/config/i386/i386.c
gcc/cp/class.c
gcc/doc/tm.texi
gcc/doc/tm.texi.in
gcc/target.def
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/mv1.C
gcc/testsuite/g++.dg/mv2.C
gcc/testsuite/g++.dg/mv3.C
gcc/testsuite/g++.dg/mv4.C
gcc/testsuite/g++.dg/mv5.C