From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116279 invoked by alias); 1 Dec 2015 10:38:26 -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 116261 invoked by uid 89); 1 Dec 2015 10:38:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.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; Tue, 01 Dec 2015 10:38:24 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B0886AD67; Tue, 1 Dec 2015 10:38:21 +0000 (UTC) Date: Tue, 01 Dec 2015 10:38:00 -0000 From: Richard Biener To: Jan Hubicka cc: gcc-patches@gcc.gnu.org Subject: Re: -fstrict-aliasing fixes 2/5: drop alias set 0 streaming In-Reply-To: <20151201043242.GA85981@kam.mff.cuni.cz> Message-ID: References: <20151201043242.GA85981@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-12/txt/msg00059.txt.bz2 On Tue, 1 Dec 2015, Jan Hubicka wrote: > Hi, > this patch disables the streaming of alias 0 flag and adds a comment why. > > Bootstrapped/regtested x86_64-linux, OK? Ok. Thanks, Richard. > Honza > > * lto-streamer-out.c (hash_tree): Do not stream TYPE_ALIAS_SET. > * tree-streamer-out.c (pack_ts_type_common_value_fields): Do not > stream TYPE_ALIAS_SET. > * tree-streamer-in.c (unpack_ts_type_common_value_fields): Do not > stream TYPE_ALIAS_SET. > > * lto.c (compare_tree_sccs_1): Do not compare TYPE_ALIAS_SET. > > Index: lto-streamer-out.c > =================================================================== > --- lto-streamer-out.c (revision 231081) > +++ lto-streamer-out.c (working copy) > @@ -1109,10 +1109,6 @@ hash_tree (struct streamer_tree_cache_d > hstate.commit_flag (); > hstate.add_int (TYPE_PRECISION (t)); > hstate.add_int (TYPE_ALIGN (t)); > - hstate.add_int ((TYPE_ALIAS_SET (t) == 0 > - || (!in_lto_p > - && get_alias_set (t) == 0)) > - ? 0 : -1); > } > > if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL)) > Index: lto/lto.c > =================================================================== > --- lto/lto.c (revision 231081) > +++ lto/lto.c (working copy) > @@ -1166,7 +1166,9 @@ compare_tree_sccs_1 (tree t1, tree t2, t > compare_values (TYPE_READONLY); > compare_values (TYPE_PRECISION); > compare_values (TYPE_ALIGN); > - compare_values (TYPE_ALIAS_SET); > + /* Do not compare TYPE_ALIAS_SET. Doing so introduce ordering issues > + with calls to get_alias_set which may initialize it for streamed > + in types. */ > } > > /* We don't want to compare locations, so there is nothing do compare > Index: tree-streamer-out.c > =================================================================== > --- tree-streamer-out.c (revision 231081) > +++ tree-streamer-out.c (working copy) > @@ -317,13 +317,9 @@ pack_ts_type_common_value_fields (struct > bp_pack_value (bp, TYPE_RESTRICT (expr), 1); > bp_pack_value (bp, TYPE_USER_ALIGN (expr), 1); > bp_pack_value (bp, TYPE_READONLY (expr), 1); > - /* Make sure to preserve the fact whether the frontend would assign > - alias-set zero to this type. Do that only for main variants, because > - type variants alias sets are never computed. > - FIXME: This does not work for pre-streamed builtin types. */ > - bp_pack_value (bp, (TYPE_ALIAS_SET (expr) == 0 > - || (!in_lto_p && TYPE_MAIN_VARIANT (expr) == expr > - && get_alias_set (expr) == 0)), 1); > + /* We used to stream TYPE_ALIAS_SET == 0 information to let frontends mark > + types that are opaque for TBAA. This however did not work as intended, > + becuase TYPE_ALIAS_SET == 0 was regularly lost in canonical type merging. */ > if (RECORD_OR_UNION_TYPE_P (expr)) > { > bp_pack_value (bp, TYPE_TRANSPARENT_AGGR (expr), 1); > Index: tree-streamer-in.c > =================================================================== > --- tree-streamer-in.c (revision 231081) > +++ tree-streamer-in.c (working copy) > @@ -366,7 +366,6 @@ unpack_ts_type_common_value_fields (stru > TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1); > TYPE_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1); > TYPE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1); > - TYPE_ALIAS_SET (expr) = bp_unpack_value (bp, 1) ? 0 : -1; > if (RECORD_OR_UNION_TYPE_P (expr)) > { > TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1); > > -- Richard Biener SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)