https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71057
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 Status|NEW |ASSIGNED CC| |rguenth at gcc dot gnu.org Known to work| |5.3.0 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Target Milestone|--- |6.2 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Hum. static void dwarf2out_finish (const char *filename) { ... /* Walk through the list of incomplete types again, trying once more to emit full debugging info for them. */ retry_incomplete_types (); that's certainly not within the spirit of early-debug. Trivial patch (on trunk free the vector): Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 236032) +++ gcc/dwarf2out.c (working copy) @@ -19401,11 +19401,13 @@ gen_entry_point_die (tree decl, dw_die_r static void retry_incomplete_types (void) { + set_early_dwarf s; int i; for (i = vec_safe_length (incomplete_types) - 1; i >= 0; i--) if (should_emit_struct_debug ((*incomplete_types)[i], DINFO_USAGE_DIR_USE)) gen_type_die ((*incomplete_types)[i], comp_unit_die ()); + vec_safe_truncate (incomplete_types, 0); } /* Determine what tag to use for a record type. */ @@ -27382,10 +27384,6 @@ dwarf2out_finish (const char *filename) resolve_addr (comp_unit_die ()); move_marked_base_types (); - /* Walk through the list of incomplete types again, trying once more to - emit full debugging info for them. */ - retry_incomplete_types (); - if (flag_eliminate_unused_debug_types) prune_unused_types (); @@ -27686,6 +27684,10 @@ dwarf2out_finish (const char *filename) static void dwarf2out_early_finish (void) { + /* Walk through the list of incomplete types again, trying once more to + emit full debugging info for them. */ + retry_incomplete_types (); + /* The point here is to flush out the limbo list so that it is empty and we don't need to stream it for LTO. */ flush_limbo_die_list ();