ipa: Fix removal of multi-target speculation.
authorJan Hubicka <jh@suse.cz>
Wed, 29 Jan 2020 11:43:10 +0000 (12:43 +0100)
committerJan Hubicka <jh@suse.cz>
Wed, 29 Jan 2020 11:43:10 +0000 (12:43 +0100)
commit7c7107778f16c2db6e97e73fdec6d6606b619864
treecde725b3ee08653f39c58d1c724feb3f6a2b94d9
parent87c3fcfa6bbb5c372d4e275276d21f601d0b62b0
ipa: Fix removal of multi-target speculation.

* cgraph.c (cgraph_edge::resolve_speculation): Only lookup direct edge
if called on indirect edge.
(cgraph_edge::redirect_call_stmt_to_callee): Lookup indirect edge of
speculative call if needed.

* gcc.dg/tree-prof/indir-call-prof-2.c: New testcase.
gcc/ChangeLog
gcc/cgraph.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c [new file with mode: 0644]