https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69513
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2016-01-28 CC| |ebotcazou at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Eric Botcazou <ebotcazou at gcc dot gnu.org> --- That's a long-standing issue with LTO and Ada. At AdaCore we use: Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 232884) +++ dwarf2out.c (working copy) @@ -27261,12 +27261,12 @@ optimize_location_lists (dw_die_ref die) static void flush_limbo_die_list (void) { - limbo_die_node *node, *next_node; + limbo_die_node *node = limbo_die_list; + limbo_die_list = NULL; - for (node = limbo_die_list; node; node = next_node) + while (node) { dw_die_ref die = node->die; - next_node = node->next; if (die->die_parent == NULL) { @@ -27303,9 +27303,18 @@ flush_limbo_die_list (void) add_child_die (origin, die); } } - } - limbo_die_list = NULL; + node = node->next; + + /* get_context_die calls force_decl_die, which can put new DIEs on the + limbo list in LTO mode when nested functions are put in a different + partition than that of their parent function. */ + if (node == NULL && in_lto_p && limbo_die_list != NULL) + { + node = limbo_die_list; + limbo_die_list = NULL; + } + } } /* Output stuff that dwarf requires at the end of every file,