Redirect reference in the symbol table (PR ipa/84833).

2018-03-16  Martin Liska  <mliska@suse.cz>

	PR ipa/84833
	* multiple_target.c (create_dispatcher_calls): Redirect
	reference in the symbol table.
2018-03-16  Martin Liska  <mliska@suse.cz>

	PR ipa/84833
	* gcc.target/i386/mvc11.c: New test.

From-SVN: r258596
This commit is contained in:
Martin Liska 2018-03-16 15:53:45 +01:00 committed by Martin Liska
parent a9a9804984
commit d5aabfc9a6
4 changed files with 43 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2018-03-16 Martin Liska <mliska@suse.cz>
PR ipa/84833
* multiple_target.c (create_dispatcher_calls): Redirect
reference in the symbol table.
2018-03-16 Martin Liska <mliska@suse.cz>
PR ipa/84722

View File

@ -144,6 +144,10 @@ create_dispatcher_calls (struct cgraph_node *node)
if (ref->referring->decl != resolver_decl)
walk_gimple_stmt (&it, NULL, replace_function_decl, &wi);
}
symtab_node *source = ref->referring;
ref->remove_reference ();
source->create_reference (inode, IPA_REF_ADDR);
}
else if (ref->use == IPA_REF_ALIAS)
{

View File

@ -1,3 +1,8 @@
2018-03-16 Martin Liska <mliska@suse.cz>
PR ipa/84833
* gcc.target/i386/mvc11.c: New test.
2018-03-16 Martin Liska <mliska@suse.cz>
PR ipa/84722

View File

@ -0,0 +1,28 @@
/* { dg-do run } */
/* { dg-require-ifunc "" } */
/* { dg-options "-std=gnu99" } */
__attribute__((noipa)) int
baz (int (*fn) (void))
{
asm volatile ("" : "+g" (fn) : : "memory");
return fn ();
}
__attribute__((target_clones("arch=sandybridge", "default"))) static int
bar (void)
{
return 1;
}
__attribute__((target_clones("arch=sandybridge", "default"))) int
foo (void)
{
baz (bar) - 1;
}
int
main ()
{
foo ();
}