diff options
author | Evgeny Stupachenko <evstupac@gmail.com> | 2015-11-03 12:02:53 +0000 |
---|---|---|
committer | Ilya Verbin <iverbin@gcc.gnu.org> | 2015-11-03 12:02:53 +0000 |
commit | f9477999894676562193eb388acf58beceb40ed0 (patch) | |
tree | 4c9627e8694b302164468c786faa4766eb51be63 /gcc/multiple_target.c | |
parent | 4bf9e5a8a2a40fb4ca87deede2cf7b0cb016cd45 (diff) | |
download | gcc-f9477999894676562193eb388acf58beceb40ed0.zip gcc-f9477999894676562193eb388acf58beceb40ed0.tar.gz gcc-f9477999894676562193eb388acf58beceb40ed0.tar.bz2 |
multiple_target.c (create_dispatcher_calls): Add target check on ifunc.
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.
From-SVN: r229706
Diffstat (limited to 'gcc/multiple_target.c')
-rw-r--r-- | gcc/multiple_target.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/multiple_target.c b/gcc/multiple_target.c index 54618d8..8cca281 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; } |