From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59890 invoked by alias); 8 Jun 2015 07:31:00 -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 59880 invoked by uid 89); 8 Jun 2015 07:30:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_50,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 08 Jun 2015 07:30:59 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B792BAC8A; Mon, 8 Jun 2015 07:30:54 +0000 (UTC) Date: Mon, 08 Jun 2015 07:35:00 -0000 From: Richard Biener To: Jan Hubicka cc: gcc-patches@gcc.gnu.org Subject: Re: Fix LTO streaming of BUILTINS_LOCATION In-Reply-To: <20150608041810.GB35779@kam.mff.cuni.cz> Message-ID: References: <20150608041810.GB35779@kam.mff.cuni.cz> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-06/txt/msg00529.txt.bz2 On Mon, 8 Jun 2015, Jan Hubicka wrote: > Hi, > currently we stream BUILTINS_LOCATION by expanding it and streaming resulting > filename/line/col tripplet. That is a nonsense and breaks some logic > that special case it. > > This patch fixes it by special casing it same way as we do UNKNOWN_LOCATION > (we have precisely 2 special location codes, so doing compound bitpack is > not needed) > > Bootstrapped/regtested ppc64le-linux, OK? > > Honza > > * lto-streamer-out.c (lto_output_location): Correctly stream > BUILTINS_LOCATION > * lto-streamer-in (lto_input_location): Likewise. > Index: lto-streamer-out.c > =================================================================== > --- lto-streamer-out.c (revision 224201) > +++ lto-streamer-out.c (working copy) > @@ -205,6 +205,9 @@ > bp_pack_value (bp, loc == UNKNOWN_LOCATION, 1); > if (loc == UNKNOWN_LOCATION) > return; > + bp_pack_value (bp, loc == BUILTINS_LOCATION, 1); > + if (loc == BUILTINS_LOCATION) > + return; Hmm, with this and #define DECL_IS_BUILTIN(DECL) \ (LOCATION_LOCUS (DECL_SOURCE_LOCATION (DECL)) <= BUILTINS_LOCATION) shouldn't we rather stream all locations <= BUILTINS_LOCATION literally? That is, instead of two bits stream a [0, BUILTINS_LOCATION+1] 'enum' here? Btw, line-map.h has RESERVED_LOCATION_COUNT for the locations that are "special" (currently two, so your patch will work in practice). > xloc = expand_location (loc); > > Index: lto-streamer-in.c > =================================================================== > --- lto-streamer-in.c (revision 224201) > +++ lto-streamer-in.c (working copy) > @@ -283,6 +283,11 @@ > *loc = UNKNOWN_LOCATION; > return; > } > + if (bp_unpack_value (bp, 1)) > + { > + *loc = BUILTINS_LOCATION; > + return; > + } > *loc = BUILTINS_LOCATION + 1; Btw, this assignment to *loc looks odd (I suppose it's to make location caching work). Richard. > file_change = bp_unpack_value (bp, 1); > > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nuernberg)