From patchwork Sun Jul 25 14:55:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: PR debug/45024 Date: Sun, 25 Jul 2010 04:55:13 -0000 From: "H.J. Lu" X-Patchwork-Id: 59874 Message-Id: To: Dodji Seketeli Cc: GCC Patches , Jason Merrill On Sun, Jul 25, 2010 at 7:38 AM, H.J. Lu wrote: > On Thu, Jul 22, 2010 at 2:44 AM, Dodji Seketeli wrote: >> Hello, >> >> Consider this testcase: >> struct S { >>  template struct T { }; >> }; >> >> S::T tval; >> >> In this PR, the DIE of S::T is not a child of the DIE of S. Rather >> it's a child of the compilation unit DIE. >> >> That patch below addresses that issue. >> >> Fully bootstrapped and tested against trunk on x86_64-unknown-linux-gnu. >> >> OK to commit to trunk? >> >>    gcc/ChangeLog: >>        PR debug/45024 >>        * dwarf2out.c (scope_die_for): Don't fall back to the compilation >>        unit DIE if we can find the scope DIE. >> >>    gcc/testsuite/ChangeLog: >>        PR debug/45024 >>        * g++.dg/debug/dwarf2/nested-2.C: New test case. >> > > This caused: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45068 I checked in this patch as an obvious fix. Index: ChangeLog =================================================================== --- ChangeLog (revision 162510) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2010-07-25 H.J. Lu + + PR testsuite/45068 + * g++.dg/debug/dwarf2/nested-2.C: Support "//" as comments. + 2010-07-24 Richard Guenther PR lto/43788 Index: g++.dg/debug/dwarf2/nested-2.C =================================================================== --- g++.dg/debug/dwarf2/nested-2.C (revision 162510) +++ g++.dg/debug/dwarf2/nested-2.C (working copy) @@ -32,6 +32,6 @@ Hence the slightly odd regexp: - { dg-final { scan-assembler "\[^\n\r\]*\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"S\\\\0\"\[ \t\]+#\[ \t\]+DW_AT_name\[\n\r\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_structure_type\\)\[\n\r\]+\[^\n\r\]*\"T\\\\0\"\[ \t\]+\(.*\)?\\(DIE\[^\n\r\]*DW_TAG_template_type_param\\)\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*\[\n\r\]+\[^\n\r\]*#\[