ipa-prop: Fix multiple-target speculation resolution
authorMartin Jambor <mjambor@suse.cz>
Wed, 7 Oct 2020 12:12:49 +0000 (14:12 +0200)
committerMartin Jambor <mjambor@suse.cz>
Wed, 7 Oct 2020 12:12:49 +0000 (14:12 +0200)
commite089e43365f7f2a90979e2316aea25d44823f5a3
tree5bfc4afe0739878724545014f51f7f8a9cf6bc88
parent99e9b54313dbb8fdb3d2a354c9554478cc33e234
ipa-prop: Fix multiple-target speculation resolution

As the FIXME which this patch removes states, the current code does
not work when a call with multiple speculative targets gets resolved
through parameter tracking during inlining - it feeds the inliner an
edge it has already dealt with.  The patch makes the code which should
prevent it aware of the possibility that that speculation can have
more than one target now.

gcc/ChangeLog:

2020-09-30  Martin Jambor  <mjambor@suse.cz>

PR ipa/96394
* ipa-prop.c (update_indirect_edges_after_inlining): Do not add
resolved speculation edges to vector of new direct edges even in
presence of multiple speculative direct edges for a single call.

gcc/testsuite/ChangeLog:

2020-09-30  Martin Jambor  <mjambor@suse.cz>

PR ipa/96394
* gcc.dg/tree-prof/pr96394.c: New test.
gcc/ipa-prop.c
gcc/testsuite/gcc.dg/tree-prof/pr96394.c [new file with mode: 0644]