From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27184 invoked by alias); 24 May 2011 17:35:07 -0000 Received: (qmail 26998 invoked by uid 22791); 24 May 2011 17:35:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 May 2011 17:34:50 +0000 Received: (qmail 12039 invoked from network); 24 May 2011 17:34:48 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 May 2011 17:34:48 -0000 Date: Tue, 24 May 2011 18:52:00 -0000 From: Nathan Froyd To: Richard Guenther Cc: gcc-patches@gcc.gnu.org Subject: Re: [PING][PATCH 13/18] move TS_EXP to be a substructure of TS_TYPED Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg01749.txt.bz2 `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_tree. > >>>> Quite anticlimatic. > >>> > >>> Ping.  http://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. But 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. Since 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. OK to commit? -Nathan gcc/ * tree.h (struct tree_exp): Inherit from struct tree_typed. * tree.c (initialize_tree_contains_struct): Mark TS_EXP as TS_TYPED instead of TS_COMMON. gcc/lto/ * lto.c (lto_ft_typed): New function. (lto_ft_common): Call it. (lto_ft_constructor): Likewise. (lto_ft_expr): Likewise. (lto_fixup_prevailing_decls): Check for TS_COMMON before accessing TREE_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) static void lto_fixup_types (tree); -/* Fix up fields of a tree_common T. */ +/* Fix up fields of a tree_typed T. */ static void -lto_ft_common (tree t) +lto_ft_typed (tree t) { - /* Fixup our type. */ LTO_FIXUP_TREE (TREE_TYPE (t)); +} + +/* Fix up fields of a tree_common T. */ +static void +lto_ft_common (tree t) +{ + lto_ft_typed (t); LTO_FIXUP_TREE (TREE_CHAIN (t)); } @@ -398,7 +404,7 @@ lto_ft_constructor (tree t) unsigned HOST_WIDE_INT idx; constructor_elt *ce; - LTO_FIXUP_TREE (TREE_TYPE (t)); + lto_ft_typed (t); for (idx = 0; VEC_iterate(constructor_elt, CONSTRUCTOR_ELTS (t), idx, ce); @@ -415,7 +421,7 @@ static void lto_ft_expr (tree t) { int i; - lto_ft_common (t); + lto_ft_typed (t); for (i = TREE_OPERAND_LENGTH (t) - 1; i >= 0; --i) LTO_FIXUP_TREE (TREE_OPERAND (t, i)); } @@ -2029,7 +2035,8 @@ lto_fixup_prevailing_decls (tree t) { enum tree_code code = TREE_CODE (t); LTO_NO_PREVAIL (TREE_TYPE (t)); - LTO_NO_PREVAIL (TREE_CHAIN (t)); + if (CODE_CONTAINS_STRUCT (code, TS_COMMON)) + LTO_NO_PREVAIL (TREE_CHAIN (t)); if (DECL_P (t)) { 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) case TS_COMPLEX: case TS_SSA_NAME: case TS_CONSTRUCTOR: + case TS_EXP: MARK_TS_TYPED (code); break; @@ -388,7 +389,6 @@ initialize_tree_contains_struct (void) case TS_TYPE_COMMON: case TS_LIST: case TS_VEC: - case TS_EXP: case TS_BLOCK: case TS_BINFO: case 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 (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind) struct GTY(()) tree_exp { - struct tree_common common; + struct tree_typed typed; location_t locus; tree block; tree GTY ((special ("tree_exp"),