From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18752 invoked by alias); 27 Sep 2011 17:17:19 -0000 Received: (qmail 18734 invoked by uid 22791); 27 Sep 2011 17:17:17 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Sep 2011 17:16:52 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id p8RHGoDr020969 for ; Tue, 27 Sep 2011 10:16:50 -0700 Received: from yia27 (yia27.prod.google.com [10.243.65.27]) by wpaz13.hot.corp.google.com with ESMTP id p8RHFfvU006029 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 27 Sep 2011 10:16:48 -0700 Received: by yia27 with SMTP id 27so6202585yia.20 for ; Tue, 27 Sep 2011 10:16:48 -0700 (PDT) Received: by 10.236.190.130 with SMTP id e2mr12979843yhn.107.1317143808555; Tue, 27 Sep 2011 10:16:48 -0700 (PDT) Received: by 10.236.190.130 with SMTP id e2mr12979827yhn.107.1317143808438; Tue, 27 Sep 2011 10:16:48 -0700 (PDT) Received: from dhcp-172-29-42-217.tor.corp.google.com (dhcp-172-29-42-217.tor.corp.google.com [172.29.42.217]) by mx.google.com with ESMTPS id 38sm39926368anu.24.2011.09.27.10.16.47 (version=SSLv3 cipher=OTHER); Tue, 27 Sep 2011 10:16:47 -0700 (PDT) Message-ID: <4E8204FE.6030009@google.com> Date: Tue, 27 Sep 2011 17:54:00 -0000 From: Diego Novillo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Gabriel Charette CC: reply@codereview.appspotmail.com, crowl@google.com, gcc-patches@gcc.gnu.org Subject: Re: [pph] Do not read pph files more than once (issue4983055) References: <20110909205432.9A2611DA1D9@topo.tor.corp.google.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2011-09/txt/msg01752.txt.bz2 On 11-09-12 10:50 , Gabriel Charette wrote: > Oops forgot to reply all the first time... > > On Fri, Sep 9, 2011 at 4:54 PM, Diego Novillo wrote: >> This was not causing any failures, but it is pretty wasteful to read >> the same PPH more than once. >> >> We cannot just skip them, however. We need to read the line table to >> properly modify the line table for the current translation unit. > > I don't think that's right. If the header is not re-read (i.e. ifdef > guarded out), it should not show in the line_table either. I think you > simply want to do this check at the top of pph_read_file itself. Thanks. I'll try this suggestion. >> @@ -1667,7 +1696,7 @@ pph_read_file (const char *filename) >> else >> error ("Cannot open PPH file for reading: %s: %m", filename); >> >> - return stream; >> + pph_add_read_image (stream); >> } > > This needs to be after the check for an already read image I think > (having it here wouldn't create test failures, but would create > duplicate entries for skipped headers (as right now they are still > added to pph_read_images when skipped I think)). Yeah, we now end up with the file mentioned twice in the vector of images. Diego.