From patchwork Tue Mar 24 17:27:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 453969 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 AC1BC14007F for ; Wed, 25 Mar 2015 04:27:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=mFpWz+Xa; dkim-adsp=none (unprotected policy); dkim-atps=neutral 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=VfAKv145ECDq1nzt9zQ7iAI5jqHeNRebLqHvlr084Axc69 RW7VzDmmszY6+BgBlso1zYp5EzqG2UPdxUvd0I/9Cb0zJyvtWbjd2+1MQOXHk7m3 ZdGC9xl+hchcHEbb0cZmOhPiXtlDWZ0xpRSuUsUfCPaaX4I8UwrfKW/eOLEuw= 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=buQpGvRssb36NeRyq6EiRJP3iok=; b=mFpWz+Xat4A0f3dcw8bp RH+W33sAdubjCQaAGdKgZfPTaP7pl3p9TtPqMRFeEk+Zru8amt2wb4SXLmlyN09o kQNpFIGAowDWqGBTtXfv0oHyFvSVakldI2PuGu2PeXvyJBV6Rwfv2JRYkohAZl9C TAdbt4SeL3F7q3N5QTTXl2Y= Received: (qmail 51283 invoked by alias); 24 Mar 2015 17:27:22 -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 51273 invoked by uid 89); 24 Mar 2015 17:27:22 -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, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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; Tue, 24 Mar 2015 17:27:21 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2OHRKIa030641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 24 Mar 2015 13:27:20 -0400 Received: from reynosa.quesejoda.com (vpn-55-16.rdu2.redhat.com [10.10.55.16]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2OHRJtw016003 for ; Tue, 24 Mar 2015 13:27:20 -0400 Message-ID: <55119E77.3040605@redhat.com> Date: Tue, 24 Mar 2015 10:27:19 -0700 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: gcc-patches Subject: [debug-early] avoid unnecessary dwarf passes I've been trying to squash DIEs that get generated too late, and here are some minor fixes. First, I'm now caching CONST_DECL DIEs. No sense recreating them in late debug. Second, I've limited gen_generic_params_dies() to early dwarf. I don't think we get any additional location info or anything later. Last, and similarly as above, imported modules shouldn't need to be generated in late debug at all. I don't think they were, but no sense going through them as part of process_scope_var in late debug. Committed to branch. Aldy commit ae58778141d336360ea4a7cb7238896eebbe797f Author: Aldy Hernandez Date: Tue Mar 24 10:17:38 2015 -0700 Cache CONST_DECL dies. Avoid unnecessary dwarf passes. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 044869d..48e2eed 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -19080,7 +19080,8 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) /* XXX */ if (!lookup_decl_die (decl)) equate_decl_number_to_die (decl, subr_die); - gen_generic_params_dies (decl); + if (early_dwarf_dumping) + gen_generic_params_dies (decl); } /* Now output descriptions of the arguments for this function. This gets @@ -19713,7 +19714,12 @@ gen_const_die (tree decl, dw_die_ref context_die) dw_die_ref const_die; tree type = TREE_TYPE (decl); + const_die = lookup_decl_die (decl); + if (const_die) + return; + const_die = new_die (DW_TAG_constant, context_die, decl); + equate_decl_number_to_die (decl, const_die); add_name_and_src_coords_attributes (const_die, decl); add_type_attribute (const_die, type, TYPE_QUAL_CONST, context_die); if (TREE_PUBLIC (decl)) @@ -21018,8 +21024,11 @@ process_scope_var (tree stmt, tree decl, tree origin, dw_die_ref context_die) if (die != NULL && die->die_parent == NULL) add_child_die (context_die, die); else if (TREE_CODE (decl_or_origin) == IMPORTED_DECL) - dwarf2out_imported_module_or_decl_1 (decl_or_origin, DECL_NAME (decl_or_origin), - stmt, context_die); + { + if (early_dwarf_dumping) + dwarf2out_imported_module_or_decl_1 (decl_or_origin, DECL_NAME (decl_or_origin), + stmt, context_die); + } else gen_decl_die (decl, origin, context_die); }