summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-03 12:02:53 +0000
committeriverbin <iverbin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-03 12:02:53 +0000
commit6ba06b42e634d384285e0ddbeeb8590ff6f370d6 (patch)
tree4c9627e8694b302164468c786faa4766eb51be63
parent9e10bfb7c761a1343ecf51cfff60e03839561962 (diff)
downloadgcc-6ba06b42e634d384285e0ddbeeb8590ff6f370d6.tar.gz
2015-11-03 Evgeny Stupachenko <evstupac@gmail.com>
gcc/ * multiple_target.c (create_dispatcher_calls): Add target check on ifunc. (create_target_clone): Change assembler name for versioned declarations. gcc/testsuite/ * g++.dg/ext/mvc4.C: Add dg-require-ifunc condition. * gcc.target/i386/mvc5.c: Ditto. * gcc.target/i386/mvc7.c: Add dg-require-ifunc condition and checks on resolver. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229706 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/multiple_target.c12
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.dg/ext/mvc4.C1
-rw-r--r--gcc/testsuite/gcc.target/i386/mvc5.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/mvc7.c4
6 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 947b9a7c8f7..97a1101d386 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-03 Evgeny Stupachenko <evstupac@gmail.com>
+
+ * multiple_target.c (create_dispatcher_calls): Add target check
+ on ifunc.
+ (create_target_clone): Change assembler name for versioned declarations.
+
2015-11-03 Thomas Schwinge <thomas@codesourcery.com>
Chung-Lin Tang <cltang@codesourcery.com>
diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c
index 54618d8ed86..8cca281b044 100644
--- a/gcc/multiple_target.c
+++ b/gcc/multiple_target.c
@@ -61,12 +61,20 @@ create_dispatcher_calls (struct cgraph_node *node)
|| !DECL_FUNCTION_VERSIONED (decl))
continue;
+ if (!targetm.has_ifunc_p ())
+ {
+ error_at (gimple_location (call),
+ "the call requires ifunc, which is not"
+ " supported by this target");
+ break;
+ }
e_next = e->next_caller;
idecl = targetm.get_function_versions_dispatcher (decl);
if (!idecl)
{
error_at (gimple_location (call),
"default target_clones attribute was not set");
+ break;
}
inode = cgraph_node::get (idecl);
gcc_assert (inode);
@@ -215,6 +223,10 @@ create_target_clone (cgraph_node *node, bool definition, char *name)
{
tree new_decl = copy_node (node->decl);
new_node = cgraph_node::get_create (new_decl);
+ /* Generate a new name for the new version. */
+ symtab->change_decl_assembler_name (new_node->decl,
+ clone_function_name (node->decl,
+ name));
}
return new_node;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c1ac2b002e5..8b9bf4c6ef7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-11-03 Evgeny Stupachenko <evstupac@gmail.com>
+
+ * g++.dg/ext/mvc4.C: Add dg-require-ifunc condition.
+ * gcc.target/i386/mvc5.c: Ditto.
+ * gcc.target/i386/mvc7.c: Add dg-require-ifunc condition and checks on
+ resolver.
+
2015-11-03 Thomas Schwinge <thomas@codesourcery.com>
* c-c++-common/goacc-gomp/nesting-fail-1.c: Move "atomic" tests
diff --git a/gcc/testsuite/g++.dg/ext/mvc4.C b/gcc/testsuite/g++.dg/ext/mvc4.C
index 98e350259d7..6e18e560476 100644
--- a/gcc/testsuite/g++.dg/ext/mvc4.C
+++ b/gcc/testsuite/g++.dg/ext/mvc4.C
@@ -1,4 +1,5 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-require-ifunc "" } */
/* { dg-options "-mavx" } */
#include <immintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/mvc5.c b/gcc/testsuite/gcc.target/i386/mvc5.c
index 0b1981d4ad6..8fea04c792b 100644
--- a/gcc/testsuite/gcc.target/i386/mvc5.c
+++ b/gcc/testsuite/gcc.target/i386/mvc5.c
@@ -1,4 +1,5 @@
/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
/* { dg-options "-fno-inline" } */
/* { dg-final { scan-assembler-times "foo.ifunc" 6 } } */
diff --git a/gcc/testsuite/gcc.target/i386/mvc7.c b/gcc/testsuite/gcc.target/i386/mvc7.c
index efc4b69aa49..9a9d7a3da30 100644
--- a/gcc/testsuite/gcc.target/i386/mvc7.c
+++ b/gcc/testsuite/gcc.target/i386/mvc7.c
@@ -1,4 +1,8 @@
/* { dg-do compile } */
+/* { dg-require-ifunc "" } */
+/* { dg-final { scan-assembler "foo.resolver" } } */
+/* { dg-final { scan-assembler "avx" } } */
+/* { dg-final { scan-assembler "slm" } } */
/* { dg-final { scan-assembler-times "foo.ifunc" 4 } } */
__attribute__((target_clones("avx","default","arch=slm","arch=core-avx2")))