From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15195 invoked by alias); 25 May 2011 08:41:58 -0000 Received: (qmail 15180 invoked by uid 22791); 25 May 2011 08:41:57 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 May 2011 08:41:43 +0000 Received: by wye20 with SMTP id 20so6737572wye.20 for ; Wed, 25 May 2011 01:41:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.203.145 with SMTP id fi17mr4267746wbb.106.1306312901686; Wed, 25 May 2011 01:41:41 -0700 (PDT) Received: by 10.227.38.129 with HTTP; Wed, 25 May 2011 01:41:41 -0700 (PDT) In-Reply-To: <20110524173443.GA498@nightcrawler> References: <1299817406-16745-1-git-send-email-froydnj@codesourcery.com> <1299817406-16745-14-git-send-email-froydnj@codesourcery.com> <4DC99DAA.30008@codesourcery.com> <4DD294ED.9080404@codesourcery.com> <4DDA6CA0.4060400@codesourcery.com> <20110524173443.GA498@nightcrawler> Date: Wed, 25 May 2011 09:59:00 -0000 Message-ID: Subject: Re: [PING][PATCH 13/18] move TS_EXP to be a substructure of TS_TYPED From: Richard Guenther To: Nathan Froyd Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-05/txt/msg01814.txt.bz2 On Tue, May 24, 2011 at 7:34 PM, Nathan Froyd wr= ote: > `0On Mon, May 23, 2011 at 04:58:06PM +0200, Richard Guenther wrote: >> On Mon, May 23, 2011 at 4:18 PM, Nathan Froyd = wrote: >> > On 05/17/2011 11:31 AM, Nathan Froyd wrote: >> >> On 05/10/2011 04:18 PM, Nathan Froyd wrote: >> >>> On 03/10/2011 11:23 PM, Nathan Froyd wrote: >> >>>> After all that, we can finally make tree_exp inherit from typed_tre= e. >> >>>> Quite anticlimatic. >> >>> >> >>> Ping. =A0http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00559.html >> >> >> >> Ping^2. >> > >> > Ping^3 to put it in Richi's INBOX. ;) >> >> Ok ;) >> >> Please check for sizeof () uses of the structs you touched sofar. >> ISTR a bug about fold-checking. > > That doesn't apply here, because I'm not renaming the struct. =A0But I did > find some problems with LTO when I was rebootstrapping prior to > committing; not sure how I missed these the first time through, maybe I > was mistakenly compiling without LTO support. =A0Since we now have things > being dumped to LTO that don't have TREE_CHAIN, we need to take care to > not access TREE_CHAIN on such things, which the patch below does. > > Tested on x86_64-unknown-linux-gnu. =A0OK to commit? Ok. Please see if you can adjust the lto-streamer-in/out.c machinery to consistently handle the new TS_ classes. Thanks, Richard. > -Nathan > > gcc/ > =A0 =A0 =A0 =A0* tree.h (struct tree_exp): Inherit from struct tree_typed. > =A0 =A0 =A0 =A0* tree.c (initialize_tree_contains_struct): Mark TS_EXP as= TS_TYPED > =A0 =A0 =A0 =A0instead of TS_COMMON. > > gcc/lto/ > =A0 =A0 =A0 =A0* lto.c (lto_ft_typed): New function. > =A0 =A0 =A0 =A0(lto_ft_common): Call it. > =A0 =A0 =A0 =A0(lto_ft_constructor): Likewise. > =A0 =A0 =A0 =A0(lto_ft_expr): Likewise. > =A0 =A0 =A0 =A0(lto_fixup_prevailing_decls): Check for TS_COMMON before a= ccessing > =A0 =A0 =A0 =A0TREE_CHAIN. > > diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c > index d64ba18..1067b51 100644 > --- a/gcc/lto/lto.c > +++ b/gcc/lto/lto.c > @@ -254,14 +254,20 @@ remember_with_vars (tree t) > > =A0static void lto_fixup_types (tree); > > -/* Fix up fields of a tree_common T. =A0*/ > +/* Fix up fields of a tree_typed T. =A0*/ > > =A0static void > -lto_ft_common (tree t) > +lto_ft_typed (tree t) > =A0{ > - =A0/* Fixup our type. =A0*/ > =A0 LTO_FIXUP_TREE (TREE_TYPE (t)); > +} > + > +/* Fix up fields of a tree_common T. =A0*/ > > +static void > +lto_ft_common (tree t) > +{ > + =A0lto_ft_typed (t); > =A0 LTO_FIXUP_TREE (TREE_CHAIN (t)); > =A0} > > @@ -398,7 +404,7 @@ lto_ft_constructor (tree t) > =A0 unsigned HOST_WIDE_INT idx; > =A0 constructor_elt *ce; > > - =A0LTO_FIXUP_TREE (TREE_TYPE (t)); > + =A0lto_ft_typed (t); > > =A0 for (idx =3D 0; > =A0 =A0 =A0 =A0VEC_iterate(constructor_elt, CONSTRUCTOR_ELTS (t), idx, ce= ); > @@ -415,7 +421,7 @@ static void > =A0lto_ft_expr (tree t) > =A0{ > =A0 int i; > - =A0lto_ft_common (t); > + =A0lto_ft_typed (t); > =A0 for (i =3D TREE_OPERAND_LENGTH (t) - 1; i >=3D 0; --i) > =A0 =A0 LTO_FIXUP_TREE (TREE_OPERAND (t, i)); > =A0} > @@ -2029,7 +2035,8 @@ lto_fixup_prevailing_decls (tree t) > =A0{ > =A0 enum tree_code code =3D TREE_CODE (t); > =A0 LTO_NO_PREVAIL (TREE_TYPE (t)); > - =A0LTO_NO_PREVAIL (TREE_CHAIN (t)); > + =A0if (CODE_CONTAINS_STRUCT (code, TS_COMMON)) > + =A0 =A0LTO_NO_PREVAIL (TREE_CHAIN (t)); > =A0 if (DECL_P (t)) > =A0 =A0 { > =A0 =A0 =A0 LTO_NO_PREVAIL (DECL_NAME (t)); > diff --git a/gcc/tree.c b/gcc/tree.c > index 3357d84..9cc99fe 100644 > --- a/gcc/tree.c > +++ b/gcc/tree.c > @@ -380,6 +380,7 @@ initialize_tree_contains_struct (void) > =A0 =A0 =A0 =A0case TS_COMPLEX: > =A0 =A0 =A0 =A0case TS_SSA_NAME: > =A0 =A0 =A0 =A0case TS_CONSTRUCTOR: > + =A0 =A0 =A0 case TS_EXP: > =A0 =A0 =A0 =A0 =A0MARK_TS_TYPED (code); > =A0 =A0 =A0 =A0 =A0break; > > @@ -388,7 +389,6 @@ initialize_tree_contains_struct (void) > =A0 =A0 =A0 =A0case TS_TYPE_COMMON: > =A0 =A0 =A0 =A0case TS_LIST: > =A0 =A0 =A0 =A0case TS_VEC: > - =A0 =A0 =A0 case TS_EXP: > =A0 =A0 =A0 =A0case TS_BLOCK: > =A0 =A0 =A0 =A0case TS_BINFO: > =A0 =A0 =A0 =A0case TS_STATEMENT_LIST: > diff --git a/gcc/tree.h b/gcc/tree.h > index 805fe06..142237f 100644 > --- a/gcc/tree.h > +++ b/gcc/tree.h > @@ -1917,7 +1917,7 @@ enum omp_clause_default_kind > =A0 (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subc= ode.default_kind) > > =A0struct GTY(()) tree_exp { > - =A0struct tree_common common; > + =A0struct tree_typed typed; > =A0 location_t locus; > =A0 tree block; > =A0 tree GTY ((special ("tree_exp"), >