aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r--gcc/dwarf2out.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 1dfff38..f9ec090 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -25256,11 +25256,11 @@ dwarf2out_early_global_decl (tree decl)
if (!DECL_STRUCT_FUNCTION (decl))
goto early_decl_exit;
- /* For nested functions, emit DIEs for the parents first so that all
- nested DIEs are generated at the proper scope in the first
- shot. */
+ /* For nested functions, make sure we have DIEs for the parents first
+ so that all nested DIEs are generated at the proper scope in the
+ first shot. */
tree context = decl_function_context (decl);
- if (context != NULL)
+ if (context != NULL && lookup_decl_die (context) == NULL)
{
current_function_decl = context;
dwarf2out_decl (context);