> Hi,
> 
> In the PR, the verifier complains that we did not manage to remove the
> body of a node and it is right.  The node is kept for materialization
> of two clones but after one is materialized, the other one is removed
> as unneeded (as a part of delete_unreachable_blocks_update_callgraph).
> The problem is that the node removal does not check for this situation
> and can leave the clone_of node there with a body attached to it even
> though there is no use for it any more.  This patch does checks for it
> and handles the situation in a simlar way that
> cgraph_node::materialize_clone does it, except that it also has to be
> careful that the removed node itself does not have any clones, which
> would still need the clone_of's body.  Failing to do that results in a
> bootstrap failure.
> 
> Bootstrapped and tested and LTO-bootstrapped on x86_64-linux.
> 
> OK for master and GCC 11?  Or should I perhaps wait for GCC 12 to
> branch and only backport to 12.2 after some time on GCC 13 master?
> 
> Thanks,
> 
> Martin
> 
> 
> gcc/ChangeLog:
> 
> 2022-04-27  Martin Jambor  <mjam...@suse.cz>
> 
>       PR ipa/100413
>       * cgraph.cc (cgraph_node::remove): Release body of the node this
>       is clone_of if appropriate.
> 
> gcc/testsuite/ChangeLog:
> 
> 2022-04-27  Martin Jambor  <mjam...@suse.cz>
> 
>       PR ipa/100413
>       * g++.dg/ipa/pr100413.C: New test.

OK, thanks!
I think it should be good for gcc 12 as well.

Honza

Reply via email to