From patchwork Thu Sep 18 19:25:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 390935 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 98CCB14018B for ; Fri, 19 Sep 2014 05:26:12 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=tOqpa9dEKIMaQdOn0QszY8VZc5PTSf+WA7FZghJV4kB8fJ SveKjGEPVJdjFKtuxpC6X3YLDNw+oVxgQicticWAyI4jY6qD/v5rv8uhzjCXS4c/ v4Pcx+E23TXdB00ZGmOU5muafgYxk+Y7Um4gGNEawK1OANrhk+vsJVXspiPWI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=JqgmUES4BJm1M6IS4Vf+/D7yIXo=; b=DOhaKYxZ42l0jCQ3ELWf S1RQi4Edh7QffMkZ1nRpmSOSl22tu6xzkmFX+Z1/DvZRRnF8TPgkuXWIPpCo3/yz 4OHxM9ZQ3rzrsoydUpCLrZnQ0aIeINQcZKINf45vedQSK0Jvs6gksTZjHQ5cTla/ 8cw58PnXNTKNFM/aZ8MUiJI= Received: (qmail 20229 invoked by alias); 18 Sep 2014 19:26:06 -0000 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 Received: (qmail 20218 invoked by uid 89); 18 Sep 2014 19:26:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 18 Sep 2014 19:25:59 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8IJPvdp009708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 18 Sep 2014 15:25:58 -0400 Received: from reynosa.quesejoda.com (vpn-53-127.rdu2.redhat.com [10.10.53.127]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8IJPuDa023251; Thu, 18 Sep 2014 15:25:56 -0400 Message-ID: <541B31C4.8010603@redhat.com> Date: Thu, 18 Sep 2014 13:25:56 -0600 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 MIME-Version: 1.0 To: gcc-patches , Richard Biener , jason merrill Subject: [debug-early] Disable removal of DW_tags* while generating subprogram DIEs This patch disables removing of DW_AT_{declaration,object_pointer,formal_parameter} tags while generating a DIE for subprograms. Now that we generate dwarf info early, we will always have an old_die the second time around. I see no need to remove the aforementioned tags, only to create them again (incorrectly in a C++ testcase I have). Previously I had the removal predicated by !old_die->dumped_early, hence removing it only if it had not been dumped early, but this is problematic since types do not have the `dumped_early' flag set. I could add a debug_hook for early_type_decl(), as we did for early_global_decl(), so we can tag dumped early types as such, but I'm _hoping_ the change here is sufficient. Things should "just work". If not, perhaps we can look into adding an early_type_decl() hook or some other solution. With this patch I am finally able to build all of libstdc++ without any ICEs, all while keeping the guality.exp tests for C at less regressions than mainline. Comitting to branch. Whine if in violent disagreement. Aldy commit 8face8fdb00474fe3e2375d08eab52726e125b8a Author: Aldy Hernandez Date: Thu Sep 18 12:37:43 2014 -0600 * dwarf2out.c (gen_subprogram_die): Disable removal of DW_AT_{declaration,object_pointer,formal_parameter}. (remove_child_TAG): Mark as ATTRIBUTE_UNUSED temporarily. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 0ad8b5d..f6c7f4a 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -4771,7 +4771,7 @@ move_all_children (dw_die_ref old_parent, dw_die_ref new_parent) /* Remove child DIE whose die_tag is TAG. Do nothing if no child matches TAG. */ -static void +static void ATTRIBUTE_UNUSED remove_child_TAG (dw_die_ref die, enum dwarf_tag tag) { dw_die_ref c; @@ -18301,17 +18301,16 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) /* ??? Hmmm, early dwarf generation happened earlier, so no sense in removing the parameters. Let's keep them and augment them with location information later. */ - if (!old_die->dumped_early) - { - /* Clear out the declaration attribute and the formal parameters. - Do not remove all children, because it is possible that this - declaration die was forced using force_decl_die(). In such - cases die that forced declaration die (e.g. TAG_imported_module) - is one of the children that we do not want to remove. */ - remove_AT (subr_die, DW_AT_declaration); - remove_AT (subr_die, DW_AT_object_pointer); - remove_child_TAG (subr_die, DW_TAG_formal_parameter); - } +#if 0 + /* Clear out the declaration attribute and the formal parameters. + Do not remove all children, because it is possible that this + declaration die was forced using force_decl_die(). In such + cases die that forced declaration die (e.g. TAG_imported_module) + is one of the children that we do not want to remove. */ + remove_AT (subr_die, DW_AT_declaration); + remove_AT (subr_die, DW_AT_object_pointer); + remove_child_TAG (subr_die, DW_TAG_formal_parameter); +#endif } else {