summaryrefslogtreecommitdiff
path: root/gcc/dwarf2out.c
diff options
context:
space:
mode:
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-10 11:06:32 +0000
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>2016-11-10 11:06:32 +0000
commitc74b2e3bf07879b8b4f96bc51310240b12291545 (patch)
tree15279e8dd6695f3a48cb4d1822e264443453539f /gcc/dwarf2out.c
parent4ec6709a3bc5910a5c8e9323f806ff74649e158d (diff)
downloadgcc-c74b2e3bf07879b8b4f96bc51310240b12291545.tar.gz
debug/78112: remove recent duplicates for DW_TAG_subprogram attributes
Disable unnecessary calls to dwarf2out_decl for the parents of nested functions. This fixes a libstdc++ build regression on x86_64-apple-darwin, as these calls used to add duplicate attributes (for instance DW_AT_inline and DW_AT_object_pointer) to the corresponding DW_TAG_subprogram DIE. Bootstrapped and regtested on x86_64-linux. gcc/ PR debug/78112 * dwarf2out.c (dwarf2out_early_global_decl): Call dwarf2out_decl on the context only when it has no DIE yet. testsuite/ PR debug/78112 * g++.dg/pr78112.C: New testcase git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242035 138bc75d-0d04-0410-961f-82ee72b054a4
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 1dfff38a862..f9ec0903b78 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);