> > 2020-04-09 Martin Jambor <mjam...@suse.cz> > > PR ipa/93621 > * ipa-inline.h (ipa_saved_clone_sources): Declare. > * ipa-inline-transform.c (ipa_saved_clone_sources): New variable. > (save_inline_function_body): Link the new body holder with the > previous one. > * cgraph.c: Include ipa-inline.h. > (cgraph_edge::redirect_call_stmt_to_callee): Try to find the decl from > the statement in ipa_saved_clone_sources. > * cgraphunit.c: Include ipa-inline.h. > (expand_all_functions): Free ipa_saved_clone_sources. As discussed on IRC this is kind of hack - we should keep track of the cloning paths if we want to allow calls to already modified decls. However this is OK for gcc 10. I believe this can trigger wrong code with earlier releases? > diff --git a/gcc/ipa-inline.h b/gcc/ipa-inline.h > index 5025b6045fc..c596f77d0e7 100644 > --- a/gcc/ipa-inline.h > +++ b/gcc/ipa-inline.h > @@ -65,6 +65,7 @@ void clone_inlined_nodes (struct cgraph_edge *e, bool, > bool, int *); > > extern int ncalls_inlined; > extern int nfunctions_inlined; > +extern function_summary <cgraph_node **> *ipa_saved_clone_sources; Please make it point to DECL itself. While symbols can be removed decls stays and we only care about decl anyway.
Honza