From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16993 invoked by alias); 11 Mar 2011 13:05:50 -0000 Received: (qmail 16864 invoked by uid 22791); 11 Mar 2011 13:05:49 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Mar 2011 13:05:44 +0000 Received: by iwn10 with SMTP id 10so2935443iwn.20 for ; Fri, 11 Mar 2011 05:05:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.42.168.196 with SMTP id x4mr2319975icy.14.1299848721767; Fri, 11 Mar 2011 05:05:21 -0800 (PST) Received: by 10.231.10.130 with HTTP; Fri, 11 Mar 2011 05:05:21 -0800 (PST) In-Reply-To: <1299817406-16745-4-git-send-email-froydnj@codesourcery.com> References: <1299817406-16745-1-git-send-email-froydnj@codesourcery.com> <1299817406-16745-4-git-send-email-froydnj@codesourcery.com> Date: Fri, 11 Mar 2011 13:05:00 -0000 Message-ID: Subject: Re: [PATCH 03/18] remove TREE_CHAIN from *_CST nodes 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-03/txt/msg00592.txt.bz2 On Fri, Mar 11, 2011 at 5:23 AM, Nathan Froyd wr= ote: > *_CST nodes don't need TREE_CHAIN. =A0Make them include typed_tree instea= d, > mark them as such in initialize_tree_contains_struct, and don't print out > their TREE_CHAIN. Ok for 4.7 if it bootstraps and tests for all languages. Richard. > -Nathan > > gcc/ > =A0 =A0 =A0 =A0* tree.h (struct tree_int_cst, struct real_value): Include= typed_tree > =A0 =A0 =A0 =A0instead of tree_common. > =A0 =A0 =A0 =A0(struct tree_fixed_cst, struct tree_string, struct tree_co= mplex): > =A0 =A0 =A0 =A0Likewise. > =A0 =A0 =A0 =A0* tree.c (initialize_tree_contains_struct): Mark such node= s as being > =A0 =A0 =A0 =A0TS_TYPED rather than TS_COMMON. > =A0 =A0 =A0 =A0* print-tree.c (print_node): Don't print TREE_CHAIN for co= nstants. > > diff --git a/gcc/print-tree.c b/gcc/print-tree.c > index b0c6899..3b5edeb 100644 > --- a/gcc/print-tree.c > +++ b/gcc/print-tree.c > @@ -853,11 +853,6 @@ print_node (FILE *file, const char *prefix, tree nod= e, int indent) > =A0 =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0fputc ('\"', file); > =A0 =A0 =A0 =A0 =A0} > - =A0 =A0 =A0 =A0 /* Print the chain at second level. =A0*/ > - =A0 =A0 =A0 =A0 if (indent =3D=3D 4) > - =A0 =A0 =A0 =A0 =A0 print_node (file, "chain", TREE_CHAIN (node), inden= t + 4); > - =A0 =A0 =A0 =A0 else > - =A0 =A0 =A0 =A0 =A0 print_node_brief (file, "chain", TREE_CHAIN (node),= indent + 4); > =A0 =A0 =A0 =A0 =A0break; > > =A0 =A0 =A0 =A0case IDENTIFIER_NODE: > diff --git a/gcc/tree.c b/gcc/tree.c > index 68f40c9..7d73c74 100644 > --- a/gcc/tree.c > +++ b/gcc/tree.c > @@ -370,15 +370,15 @@ initialize_tree_contains_struct (void) > =A0 =A0 =A0 =A0 =A0break; > > =A0 =A0 =A0 =A0case TS_COMMON: > - =A0 =A0 =A0 =A0 MARK_TS_TYPED (code); > - =A0 =A0 =A0 =A0 break; > - > =A0 =A0 =A0 =A0case TS_INT_CST: > =A0 =A0 =A0 =A0case TS_REAL_CST: > =A0 =A0 =A0 =A0case TS_FIXED_CST: > =A0 =A0 =A0 =A0case TS_VECTOR: > =A0 =A0 =A0 =A0case TS_STRING: > =A0 =A0 =A0 =A0case TS_COMPLEX: > + =A0 =A0 =A0 =A0 MARK_TS_TYPED (code); > + =A0 =A0 =A0 =A0 break; > + > =A0 =A0 =A0 =A0case TS_IDENTIFIER: > =A0 =A0 =A0 =A0case TS_DECL_MINIMAL: > =A0 =A0 =A0 =A0case TS_TYPE: > diff --git a/gcc/tree.h b/gcc/tree.h > index 4ad2d3e..11c2f83 100644 > --- a/gcc/tree.h > +++ b/gcc/tree.h > @@ -1456,7 +1456,7 @@ extern void omp_clause_range_check_failed (const_tr= ee, const char *, int, > =A0 =A0 =A0 =A0&& TREE_INT_CST_LOW (A) < TREE_INT_CST_LOW (B))) > > =A0struct GTY(()) tree_int_cst { > - =A0struct tree_common common; > + =A0struct typed_tree typed; > =A0 double_int int_cst; > =A0}; > > @@ -1469,7 +1469,7 @@ struct real_value; > =A0#define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE)) > > =A0struct GTY(()) tree_real_cst { > - =A0struct tree_common common; > + =A0struct typed_tree typed; > =A0 struct real_value * real_cst_ptr; > =A0}; > > @@ -1481,7 +1481,7 @@ struct fixed_value; > =A0#define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE)) > > =A0struct GTY(()) tree_fixed_cst { > - =A0struct tree_common common; > + =A0struct typed_tree typed; > =A0 struct fixed_value * fixed_cst_ptr; > =A0}; > > @@ -1491,7 +1491,7 @@ struct GTY(()) tree_fixed_cst { > =A0 ((const char *)(STRING_CST_CHECK (NODE)->string.str)) > > =A0struct GTY(()) tree_string { > - =A0struct tree_common common; > + =A0struct typed_tree typed; > =A0 int length; > =A0 char str[1]; > =A0}; > @@ -1501,7 +1501,7 @@ struct GTY(()) tree_string { > =A0#define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag) > > =A0struct GTY(()) tree_complex { > - =A0struct tree_common common; > + =A0struct typed_tree typed; > =A0 tree real; > =A0 tree imag; > =A0}; > @@ -1510,7 +1510,7 @@ struct GTY(()) tree_complex { > =A0#define TREE_VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.el= ements) > > =A0struct GTY(()) tree_vector { > - =A0struct tree_common common; > + =A0struct typed_tree typed; > =A0 tree elements; > =A0}; > > -- > 1.7.0.4 > >