From patchwork Thu Oct 4 19:37:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Koning X-Patchwork-Id: 189260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 855F82C038C for ; Fri, 5 Oct 2012 05:38:14 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1349984295; h=Comment: DomainKey-Signature:Received:Received:Received:From:To:CC: Subject:Date:Message-ID:References:In-Reply-To:Content-Type: Content-ID:Content-Transfer-Encoding:MIME-Version:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=ERnDa2zSM0k3dPkveRdHIVVTang=; b=XbhW+jfS1s7xCqTlwVPaP6wO+2YyTgQj3lifLnGVK2qRmd10VQ00xZ915tAjSO DVXqzgX2ovzMOuXqLH+tHIyvqq391ApKNp4/CUHEFmi8vpS2hx0H6LYdCmWfW0zG MIj7hPaKeucQ96nhzecJacfWJeZaJRdFVp4nt4xUoxmnc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:X-Loopcount0:From:To:CC:Subject:Date:Message-ID:References:In-Reply-To:Content-Type:Content-ID:Content-Transfer-Encoding:MIME-Version:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=pap9CYhS3QRLjmYPMG8Q50JmghpPKivfhWdBcHfF0Elk5+LOQ6HLwt/4Lh1E2a ZGbl7av5CvETP5k220jURu3yH7fRc5M32hwtF9fu/0DHHxlUIi6wJYx+ni83TtDQ lbovNkqmdTqXsYH7ujYcPvOBBTvS5QQpg5WVk7QhirIHo=; Received: (qmail 4326 invoked by alias); 4 Oct 2012 19:38:09 -0000 Received: (qmail 4308 invoked by uid 22791); 4 Oct 2012 19:38:08 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausxipps301.us.dell.com (HELO ausxipps301.us.dell.com) (143.166.148.223) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 04 Oct 2012 19:38:00 +0000 X-Loopcount0: from 10.175.216.251 From: To: CC: , , Subject: Re: PING^2: [patch] pr/54508: fix incomplete debug information for class Date: Thu, 4 Oct 2012 19:37:58 +0000 Message-ID: References: <20121004185835.GF1787@tucnak.redhat.com> In-Reply-To: <20121004185835.GF1787@tucnak.redhat.com> Content-ID: <0C6DFB951720B041BD95529084D736DD@dell.com> MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On Oct 4, 2012, at 2:58 PM, Jakub Jelinek wrote: > On Thu, Oct 04, 2012 at 06:32:20PM +0000, Paul_Koning@Dell.com wrote: >> --- testsuite/g++.dg/debug/dwarf2/pr54508.C (revision 0) >> +++ testsuite/g++.dg/debug/dwarf2/pr54508.C (revision 0) >> @@ -0,0 +1,67 @@ >> +// PR debug/54508 >> +// { dg-do compile } >> +// { dg-options "-g2 -dA" } > > Better than this just add -fno-merge-debug-strings to dg-options > >> + >> +// { dg-final { scan-assembler "\"cbase\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name\|DW_AT_name: \"cbase\"" } } >> +// { dg-final { scan-assembler "\"OPCODE\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name\|DW_AT_name: \"OPCODE\"" } } >> +// { dg-final { scan-assembler "\"bi\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } >> +// { dg-final { scan-assembler "\"si\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } >> +// { dg-final { scan-assembler "\"f1\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } >> +// { dg-final { scan-assembler "\"f2\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } >> +// { dg-final { scan-assembler-not "\"nc\\\\0\"\[ \t\]+\# DW_AT_name\|DW_AT_name: \"nc\"" } } > > and use just one of the alternatives in the regexps. > > Jakub Thanks... learn something new every day. Here is the updated patch. paul ChangeLog: 2012-10-04 Paul Koning * dwarf2out.c (prune_unused_types_mark): Mark all of parent's children if parent is a class. testsuite/ChangeLog: 2012-10-04 Paul Koning * g++.dg/debug/dwarf2/pr54508.C: New. Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 192048) +++ gcc/dwarf2out.c (working copy) @@ -21035,9 +21035,11 @@ prune_unused_types_mark_generic_parms_dies (die); /* We also have to mark its parents as used. - (But we don't want to mark our parents' kids due to this.) */ + (But we don't want to mark our parent's kids due to this, + unless it is a class.) */ if (die->die_parent) - prune_unused_types_mark (die->die_parent, 0); + prune_unused_types_mark (die->die_parent, + class_scope_p (die->die_parent)); /* Mark any referenced nodes. */ prune_unused_types_walk_attribs (die); Index: gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C =================================================================== --- gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C (revision 0) +++ gcc/testsuite/g++.dg/debug/dwarf2/pr54508.C (revision 0) @@ -0,0 +1,67 @@ +// PR debug/54508 +// { dg-do compile } +// { dg-options "-g2 -dA -fno-merge-debug-strings" } + +// { dg-final { scan-assembler "\"cbase\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } +// { dg-final { scan-assembler "\"OPCODE\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } +// { dg-final { scan-assembler "\"bi\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } +// { dg-final { scan-assembler "\"si\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } +// { dg-final { scan-assembler "\"f1\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } +// { dg-final { scan-assembler "\"f2\\\\0\"\[ \t\]+\[#;/!|@\]+ DW_AT_name" } } +// { dg-final { scan-assembler-not "\"nc\\\\0\"\[ \t\]+\# DW_AT_name" } } + +class cbase + +{ +public: + static int si; + int bi; +}; + +class c : public cbase + +{ +public: + enum + { + OPCODE = 251 + }; + int i ; + static const char *testc (void) { return "foo"; } +}; + +struct s +{ + int f1; + static const char *tests (void) { return "test"; } +}; + +union u +{ + int f2; + double d; + static const char *testu (void) { return "test union"; } +}; + +namespace n +{ + const char *ntest (void) { return "test n"; } + + class nc + { + public: + int i; + static int sj; + }; +} + +extern void send (int, int, const void *, int); + +void test (int src) +{ + int cookie = 1; + send(src, c::OPCODE, c::testc (), cookie); + send(src, c::OPCODE, s::tests (), cookie); + send(src, c::OPCODE, u::testu (), cookie); + send(src, c::OPCODE, n::ntest (), cookie); +}