aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 6d5e3f540f5..0bbff87a95e 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -27281,12 +27281,15 @@ optimize_location_lists (dw_die_ref die)
static void
flush_limbo_die_list (void)
{
- limbo_die_node *node, *next_node;
+ limbo_die_node *node;
- for (node = limbo_die_list; node; node = next_node)
+ /* 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. */
+ while ((node = limbo_die_list))
{
dw_die_ref die = node->die;
- next_node = node->next;
+ limbo_die_list = node->next;
if (die->die_parent == NULL)
{
@@ -27324,8 +27327,6 @@ flush_limbo_die_list (void)
}
}
}
-
- limbo_die_list = NULL;
}
/* Output stuff that dwarf requires at the end of every file,
@@ -27685,10 +27686,15 @@ dwarf2out_finish (const char *filename)
static void
dwarf2out_early_finish (void)
{
- limbo_die_node *node;
+ /* 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 ();
+
+ gen_scheduled_generic_parms_dies ();
+ gen_remaining_tmpl_value_param_die_attribute ();
/* Add DW_AT_linkage_name for all deferred DIEs. */
- for (node = deferred_asm_name; node; node = node->next)
+ for (limbo_die_node *node = deferred_asm_name; node; node = node->next)
{
tree decl = node->created_for;
if (DECL_ASSEMBLER_NAME (decl) != DECL_NAME (decl)
@@ -27702,13 +27708,6 @@ dwarf2out_early_finish (void)
}
}
deferred_asm_name = NULL;
-
- /* 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 ();
-
- gen_scheduled_generic_parms_dies ();
- gen_remaining_tmpl_value_param_die_attribute ();
}
/* Reset all state within dwarf2out.c so that we can rerun the compiler