https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78835

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
So initially we generate

DIE    0: DW_TAG_GNU_call_site (0x7ffff68cd690)
  abbrev id: 0 offset: 0 mark: 0
  DW_AT_low_pc: label: *.LVL1
  DW_AT_abstract_origin: address

but that later gets rewritten invalidly where Jakub points out.  The regression
is because we prune the DIE for Baz as unused after

  /* Generate separate COMDAT sections for type DIEs. */
  if (use_debug_types)
    {
      break_out_comdat_types (comp_unit_die ());

... now it is in a type unit ...

      /* In the process of copying declarations from one unit to another,
         we may have left some declarations behind that are no longer
         referenced.  Prune them.  */
      prune_unused_types ();
    }

... and gets pruned.  But nothing adjusts what the decl refers to via
lookup_decl_die (not sure if we are supposed to adjust sth here).

Previously the call-site attribute kept the DIE live in the main CU DIE so
we had duplicate DIEs in the type unit plus the main CU.  With -gstrict-dwarf
it is only on the type unit as expected.

Reply via email to