From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19123 invoked by alias); 4 Sep 2014 17:53:39 -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 19112 invoked by uid 89); 4 Sep 2014 17:53:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f50.google.com Received: from mail-oa0-f50.google.com (HELO mail-oa0-f50.google.com) (209.85.219.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 04 Sep 2014 17:53:36 +0000 Received: by mail-oa0-f50.google.com with SMTP id o6so7501402oag.37 for ; Thu, 04 Sep 2014 10:53:34 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.107.234 with SMTP id hf10mr7396219obb.22.1409853214674; Thu, 04 Sep 2014 10:53:34 -0700 (PDT) Received: by 10.76.72.4 with HTTP; Thu, 4 Sep 2014 10:53:34 -0700 (PDT) In-Reply-To: <540755E5.7060602@redhat.com> References: <53FD45A7.4000804@redhat.com> <53FF6840.9030505@redhat.com> <53FF6E61.6030507@redhat.com> <540755E5.7060602@redhat.com> Date: Thu, 04 Sep 2014 17:53:00 -0000 Message-ID: Subject: Re: [debug-early] reuse variable DIEs and fix their context From: "H.J. Lu" To: Aldy Hernandez Cc: Jason Merrill , Richard Biener , gcc-patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00381.txt.bz2 On Wed, Sep 3, 2014 at 10:54 AM, Aldy Hernandez wrote: > [Jason, Richard]: Is it useful for my patches to contain ChangeLog entries? > I find them mildly annoying for something that will inevitably be rewritten > multiple times, but if it aids in reviewing my WIP, I am more than happy to > continue including them. > > > On 08/28/14 11:01, Jason Merrill wrote: >> >> On 08/28/2014 01:34 PM, Aldy Hernandez wrote: >>> >>> I wonder if instead of early dumping of all the DECLs, we could only >>> dump the toplevel scoped DECLs, and let inheritance set the proper >>> contexts. >> >> >> Yes, I think this makes a lot more sense; do it at a well-defined point >> in compilation rather than as part of free_lang_data. > > > Great. It turned out, this was a cleaner approach as well. > > >>> The problem being that to calculate `ext_block' above, we need intimate >>> knowledge of scopes and such, only available in the FE. Is there a >>> generic way of determining if a DECL is in global scope? >> >> >> Why not do it in the FE, i.e. *_write_global_declarations? > > > This is what I've done in this patch. > > I'm no longer generating dwarf early from free_lang_data, instead I'm using > the global_decl debug hook and adding an EARLY argument. Then I call it > twice, once after the FE is done, and once after the full compilation has > finished (cgraph has been generated, etc). The goal is to have the first > pass generate the DIEs and the 2nd pass fill in location information and > such. > > Generating the globals first solves the context issue. The recursive nature > of generating DIEs gets everything right. For that matter, > with the attached patch, I actually get *LESS* guality failures than before. > Unexpected, but I'm not going to complain ;-). > > I have added a few (temporary) checks to make sure we're not regenerating > DIEs when we already have one (at least for DECLs). These should go away > after this work is incorporated into mainline. > > FYI, I am only handling C for now while we iron out the general idea. > > How does this look? > I think this merge caused bootstrap failure on Linux/i686 https://gcc.gnu.org/ml/gcc-regression/2014-09/msg00010.html -- H.J.