> Hi, > > since r278669 (fix for PR ipa/91956), IPA-SRA makes sure that the clone > it creates is put into the same same_comdat as the original cgraph_node, > so that it can call private comdats (such as the ipa-split bits of a > comdat that is private). > > However, that means that if there is non-comdat caller of a public > comdat that is modified by IPA-SRA, it now finds itself calling a > private comdat, which call graph verifier does not like (and for a > reason, in theory it can disappear and since it is private it would not > be available from other CUs). > > The patch fixes this by performing the fix for PR 91956 only when the > node in question actually calls a local comdat and when it does, also > making sure that no callers come from a different same_comdat (disabling > IPA-SRA if both conditions are true), so that it plays by the rules in > both modes, does not violate the private comdat calling rule and at the > same time does not disable the transformation unnecessarily. > > The patch also fixes up the calls_comdat_local of callers of the > modified node, despite that not triggering any known issues. It has > passed LTO-bootstrap and testing. What do you think? > > Thanks, > > Martin > > > 2019-12-16 Martin Jambor <mjam...@suse.cz> > > PR ipa/92676 > * ipa-sra.c (struct caller_issues): New fields candidate and > call_from_outside_comdat. > (check_for_caller_issues): Check for calls from outsied of > candidate's same_comdat_group. > (check_all_callers_for_issues): Set up issues.candidate, check result > of the new check. > (process_isra_node_results): Set calls_comdat_local of callers if > appropriate.
OK except for ... > @@ -3759,8 +3778,12 @@ process_isra_node_results (cgraph_node *node, > = node->create_virtual_clone (callers, NULL, new_adjustments, "isra", > suffix_counter); > suffix_counter++; > - if (node->same_comdat_group) > - new_node->add_to_same_comdat_group (node); > + if (node->calls_comdat_local && node->same_comdat_group) > + { > + new_node->add_to_same_comdat_group (node); > + for (cgraph_edge *cs = new_node->callers; cs; cs = cs->next_caller) > + cs->caller->calls_comdat_local = true; You need to walk all aliases here. > + } > new_node->calls_comdat_local = node->calls_comdat_local; > > if (dump_file) > -- > 2.24.0 >