On 06/26/2018 06:43 AM, Richard Biener wrote: > > A patch from Honza not LTO streaming DECL_ORIGINAL_TYPE ends up > ICEing during LTO bootstrap because we end up not re-using the > DIE we create late during LTRANS for a subprogram because its > parent is a namespace rather than a CU DIE (or a module). > > I'm wondering of the general reason why we enforce (inconsistently) > "We always want the DIE for this function that has the *_pc attributes to > be under comp_unit_die so the debugger can find it." > We indeed generate a specification DIE rooted at the CU in addition to the > declaration DIE inside the namespace for sth as simple as > > namespace Foo { void foo () {} } > > anyhow - the comment also says "We also need to do this [re-use the DIE] > for abstract instances of inlines, since the spec requires the out-of-line > copy to have the same parent.". Not sure what condition this part of > the comment applies to. > > So my fix is to move the || get_AT (old_die, DW_AT_abstract_origin) > check I added for early LTO debug to a global override - forcing > DIE re-use for any DIE with an abstract origin set. That is, all > concrete instances are fine where they are. That also avoids > double-indirection DW_AT_specification -> DW_AT_abstract_origin -> DIE. > > But as said, I wonder about the overall condition, esp. the > DW_TAG_module special-casing (but not at the same time > special-casing DW_TAG_namespace or DW_TAG_partial_unit). > > LTO bootstrap is in progress on x86_64-unknown-linux-gnu. > > OK if that succeeds? > > Thanks, > Richard. > > 2018-06-26 Richard Biener <rguent...@suse.de> > > * dwarf2out.c (gen_subprogram_die): Always re-use DIEs with an > DW_AT_abstract_origin attribute. Explicitly deferring to Jason here.
jeff