From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95107 invoked by alias); 31 May 2017 07:34:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 95091 invoked by uid 89); 31 May 2017 07:34:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-spam-relays-external:209.85.218.51, H*RU:209.85.218.51 X-HELO: mail-oi0-f51.google.com Received: from mail-oi0-f51.google.com (HELO mail-oi0-f51.google.com) (209.85.218.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 May 2017 07:34:12 +0000 Received: by mail-oi0-f51.google.com with SMTP id w10so5574001oif.0 for ; Wed, 31 May 2017 00:34:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+mtXNUXHUGSl5Ds5hLMAM50B2yMLApGMpxazy9AyWZs=; b=WlKTzv/pwJ3vX+qrUF7u3fNuI4Ngv7HLZSIC10E0T+ilL7yjgxFdJxnKMVe2SRKzrk uNjQjgkqpgPjPcYG2jiKkzIEHpZzdru5+0n2/tqDDN7s9Y8nl20cmORLeAHbTZEO3gpf nE30kv+sg1ltVJSHSM51b3IKckVSsAzA2v8Fv22osIogEGm6bK1P4fd76b75CYpprlqi l3ntVt5YybF1CefNow1z3kkryf538xIPXEBRNrdZ3mHnJFe3fnIWnVGrU+Xop4NYOreU xdp7ZHNhRKYycfG4m+zq8MO3U4b21nIXaQz4+HRqiE5dw3orB+oo97/nEUm3LDjBeruK GISQ== X-Gm-Message-State: AODbwcCXK0SK2eH9q4w12Ki6m5i+q/zUofC8v+ufClezVQURK5mreIfx Qg3PZ2w3XqGU/t8AYFOeUuFRdsn2DQ== X-Received: by 10.157.15.198 with SMTP id m6mr6081531otd.210.1496216054925; Wed, 31 May 2017 00:34:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.51.83 with HTTP; Wed, 31 May 2017 00:34:14 -0700 (PDT) In-Reply-To: References: <20170529075011.15538-1-derodat@adacore.com> <20170529075011.15538-2-derodat@adacore.com> From: Richard Biener Date: Wed, 31 May 2017 07:37:00 -0000 Message-ID: Subject: Re: [PATCH 2/2] DWARF: make it possible to emit debug info for declarations only To: Pierre-Marie de Rodat Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg02314.txt.bz2 On Tue, May 30, 2017 at 5:47 PM, Pierre-Marie de Rodat wrote: > Thank you for your review, Richard. > > On 05/30/2017 01:59 PM, Richard Biener wrote: >> >> I think the issue is unfortunate in the C frontend as well. So I believe >> we can >> go without a new langhook and instead make sure >> dwarf2out_early_global_decl >> is not called for uninteresting decls (which means eventually pushing the >> call(s) of that hook more towards the FEs). > > > It is called by rest_of_decl_compilation, which seems itself to be called a > lot on FUNCTION_DECL nodes. Before I dive into this consequent change: this > would lead for instance to add a parameter to rest_of_compilation to control > whether it must call the early_global_decl hook, and then to update all > callers accordingly. Is this what you actually have in mind? Actually for the bigger picture I'd refactor rest_of_decl_compilation, not calling it from the frontends but rely on finalize_decl/function. The missing part would then be calling the dwarf hook which should eventually be done at some of the places the frontends now call rest_of_decl_compliation. > >> For C/C++ it would be reasonable to output debug info for external >> declarations >> that end up being used for example. > > > I guess that could be done indeed. :-) But for an easier way (you might still explore the above ;)) just remove the guards from dwarf2out.c and handle it more like types that we prune if they end up being unused (OTOH I guess we don't refer to the decl DIEs from "calls" because not all calls are refered to with standard DWARF -- the GNU callsite stuff refers them I think but those get generated too late). That said, when early_finish is called the cgraph and IPA references exists and thus you can sort-of see which functions are "used". Richard. > -- > Pierre-Marie de Rodat