debug/78112: remove recent duplicates for DW_TAG_subprogram attributes
authorPierre-Marie de Rodat <derodat@adacore.com>
Thu, 10 Nov 2016 11:06:32 +0000 (11:06 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Thu, 10 Nov 2016 11:06:32 +0000 (11:06 +0000)
commited5fdfba23ed1d25a07c0fbcccb8aaea138a5d88
tree15279e8dd6695f3a48cb4d1822e264443453539f
parentb854516cc1943199ce15a23df340a7d2d7196a56
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
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pr78112.C [new file with mode: 0644]