On 03/29/2017 01:42 PM, Jakub Jelinek wrote:
Hi!
When a C++17 inline static data member has a redundant out-of-class
deprecated redeclaration, we can end up with 2 DW_TAG_variable in
DW_TAG_compile_unit, one DW_AT_declaration and one with DW_AT_specification
pointing to it (the latter emitted for the redeclaration), before
gen_member_die can do its job. In there we want to move the declaration
DIE into the class and have a CU child DW_TAG_variable that has
DW_AT_specification pointing to it. But in this case we've put
the DIE with DW_AT_specification into the hash table and gen_member_die
ICEs in splice_child_die. The following patch handles that case gracefully,
by moving the DW_AT_declaration DIE into the class instead of trying to
move the DW_AT_specification one, and by making sure we don't create
yet another DIE with DW_AT_specification because we already have one.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2017-03-29 Jakub Jelinek <ja...@redhat.com>
PR debug/80234
* dwarf2out.c (gen_member_die): Handle C++17 inline static data
members with redundant out-of-class redeclaration.
* g++.dg/debug/dwarf2/pr80234-1.C: New test.
* g++.dg/debug/dwarf2/pr80234-2.C: New test.
OK.
jeff