diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2016-11-10 11:06:32 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2016-11-10 11:06:32 +0000 |
commit | ed5fdfba23ed1d25a07c0fbcccb8aaea138a5d88 (patch) | |
tree | 15279e8dd6695f3a48cb4d1822e264443453539f /gcc/dwarf2out.c | |
parent | b854516cc1943199ce15a23df340a7d2d7196a56 (diff) | |
download | gcc-ed5fdfba23ed1d25a07c0fbcccb8aaea138a5d88.zip gcc-ed5fdfba23ed1d25a07c0fbcccb8aaea138a5d88.tar.gz gcc-ed5fdfba23ed1d25a07c0fbcccb8aaea138a5d88.tar.bz2 |
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
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r242035
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 8 |
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); |