]> gcc.gnu.org Git - gcc.git/commit
ipa-cp: Avoid adjusting references through self-recursion (PR 104813)
authorMartin Jambor <mjambor@suse.cz>
Thu, 10 Mar 2022 13:49:23 +0000 (14:49 +0100)
committerMartin Jambor <mjambor@suse.cz>
Thu, 10 Mar 2022 13:50:54 +0000 (14:50 +0100)
commite671e48e352ee278d816d4633146208807a0e403
treed3f8d1b5c97d31ca8a68c953618831280844347b
parentee34ffa429a399f292ad1421333721a92b998772
ipa-cp: Avoid adjusting references through self-recursion (PR 104813)

When writing the patch that downgrades address-taken references to
load references when IPA-CP can prove that all uses of the taken
address ends up in loads, I unfortunately did not take into account
that find_more_scalar_values_for_callers_subset now happily adds
self-recursive edges to the set of callers which should be immediately
redirected (originally recursion was meant to be handled as edge
redirection in a second pass over the SCC).

The code as it is can now decrement the referece counters too many
times.  This can remedied by removing self-recursive edges earlier, we
already do it because of thunk expansion issues, and so this patch
does exactly that.

gcc/ChangeLog:

2022-03-07  Martin Jambor  <mjambor@suse.cz>

PR ipa/104813
* ipa-cp.cc (create_specialized_node): Move removal of
self-recursive calls from callers vector before refrence
adjustments.

gcc/testsuite/ChangeLog:

2022-03-07  Martin Jambor  <mjambor@suse.cz>

PR ipa/104813
* gcc.dg/ipa/pr104813.c: New test.
gcc/ipa-cp.cc
gcc/testsuite/gcc.dg/ipa/pr104813.c [new file with mode: 0644]
This page took 0.065502 seconds and 6 git commands to generate.