From patchwork Wed Dec 1 03:31:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurynas Biveinis X-Patchwork-Id: 73693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E6CCCB70FE for ; Wed, 1 Dec 2010 14:32:03 +1100 (EST) Received: (qmail 27772 invoked by alias); 1 Dec 2010 03:32:00 -0000 Received: (qmail 27755 invoked by uid 22791); 1 Dec 2010 03:31:59 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, TW_CD, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Dec 2010 03:31:54 +0000 Received: by eya28 with SMTP id 28so3299566eya.20 for ; Tue, 30 Nov 2010 19:31:51 -0800 (PST) Received: by 10.213.31.210 with SMTP id z18mr3542006ebc.41.1291174309978; Tue, 30 Nov 2010 19:31:49 -0800 (PST) Received: from [192.168.0.50] (cable-236-212.cgates.lt [79.133.236.212]) by mx.google.com with ESMTPS id b52sm7055027eei.7.2010.11.30.19.31.48 (version=SSLv3 cipher=RC4-MD5); Tue, 30 Nov 2010 19:31:49 -0800 (PST) Message-ID: <4CF5C1A1.5000900@gmail.com> Date: Wed, 01 Dec 2010 05:31:45 +0200 From: Laurynas Biveinis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [PATCH] [c++][ada][middle-end] Remove redundant GTY markers from structs X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I am working on a patch to diagnose redundant GTY markers. It is not completed (possibly it will not be completed at all, at least not for 4.6: it is likely that to get false positive numbers to zero it will be necessary to preprocess GTY input), but it is already useful to remove some GTY instances in GCC. Bootstrapped r167283 with this patch and regtested against r167293 with no regressions on x86_64/linux. OK for trunk? Also, while preparing this patch I have noticed that some of these types (for example, struct edge_prediction) are used in a single source file only. I will prepare a patch to move them. 2010-11-30 Laurynas Biveinis * tree.h (struct call_expr_arg_iterator_d): Remove GTY tag. (const_call_expr_arg_iterator_d): Likewise. (expanded_location): Likewise. * c-tree.h (struct c_arg_tag_d): Likewise. * dwarf2out.c (struct cfa_loc): Likewise. (struct skeleton_chain_struct): Likewise. * except.c (struct ttypes_filter): Likewise. * cselib.h (struct cselib_val_struct): Likewise. (elt_loc_list): Likewise. (elt_list): Likewise. * varasm.c (struct addr_const): Likewise. * tree-flow.h (struct edge_prediction): Likewise. (struct int_tree_map): Likewise. (struct _edge_var_map): Likewise. ada: 2010-11-30 Laurynas Biveinis * gcc-interface/decl.c (struct subst_pair_d): Remove GTY tag. (variant_desc_d): Likewise. cp: 2010-11-30 Laurynas Biveinis * cp-tree.h (struct aggr_init_expr_arg_iterator_d): Remove GTY tag. Index: gcc/tree.h =================================================================== --- gcc/tree.h (revision 167283) +++ gcc/tree.h (working copy) @@ -5598,13 +5598,13 @@ defined by this point. */ /* Structure containing iterator state. */ -typedef struct GTY (()) call_expr_arg_iterator_d { +typedef struct call_expr_arg_iterator_d { tree t; /* the call_expr */ int n; /* argument count */ int i; /* next argument index */ } call_expr_arg_iterator; -typedef struct GTY (()) const_call_expr_arg_iterator_d { +typedef struct const_call_expr_arg_iterator_d { const_tree t; /* the call_expr */ int n; /* argument count */ int i; /* next argument index */ Index: gcc/input.h =================================================================== --- gcc/input.h (revision 167283) +++ gcc/input.h (working copy) @@ -37,7 +37,7 @@ extern char builtins_location_check[(BUILTINS_LOCATION < RESERVED_LOCATION_COUNT) ? 1 : -1]; -typedef struct GTY (()) +typedef struct { /* The name of the source file involved. */ const char *file; Index: gcc/cp/cp-tree.h =================================================================== --- gcc/cp/cp-tree.h (revision 167283) +++ gcc/cp/cp-tree.h (working copy) @@ -2840,7 +2840,7 @@ /* Abstract iterators for AGGR_INIT_EXPRs. */ /* Structure containing iterator state. */ -typedef struct GTY (()) aggr_init_expr_arg_iterator_d { +typedef struct aggr_init_expr_arg_iterator_d { tree t; /* the aggr_init_expr */ int n; /* argument count */ int i; /* next argument index */ Index: gcc/c-tree.h =================================================================== --- gcc/c-tree.h (revision 167283) +++ gcc/c-tree.h (working copy) @@ -294,7 +294,7 @@ cdk_attrs }; -typedef struct GTY(()) c_arg_tag_d { +typedef struct c_arg_tag_d { /* The argument name. */ tree id; /* The type of the argument. */ Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 167283) +++ gcc/dwarf2out.c (working copy) @@ -282,7 +282,7 @@ It can now be either REG + CFA_OFFSET or *(REG + BASE_OFFSET) + CFA_OFFSET. Instead of passing around REG and OFFSET, we pass a copy of this structure. */ -typedef struct GTY(()) cfa_loc { +typedef struct cfa_loc { HOST_WIDE_INT offset; HOST_WIDE_INT base_offset; unsigned int reg; @@ -5879,7 +5879,7 @@ } limbo_die_node; -typedef struct GTY(()) skeleton_chain_struct +typedef struct skeleton_chain_struct { dw_die_ref old_die; dw_die_ref new_die; Index: gcc/ada/gcc-interface/decl.c =================================================================== --- gcc/ada/gcc-interface/decl.c (revision 167283) +++ gcc/ada/gcc-interface/decl.c (working copy) @@ -97,7 +97,7 @@ static int defer_finalize_level = 0; static VEC (tree,heap) *defer_finalize_list; -typedef struct GTY(()) subst_pair_d { +typedef struct subst_pair_d { tree discriminant; tree replacement; } subst_pair; @@ -105,7 +105,7 @@ DEF_VEC_O(subst_pair); DEF_VEC_ALLOC_O(subst_pair,heap); -typedef struct GTY(()) variant_desc_d { +typedef struct variant_desc_d { /* The type of the variant. */ tree type; Index: gcc/except.c =================================================================== --- gcc/except.c (revision 167283) +++ gcc/except.c (working copy) @@ -681,7 +681,7 @@ /* Represent an entry in @TTypes for either catch actions or exception filter actions. */ -struct GTY(()) ttypes_filter { +struct ttypes_filter { tree t; int filter; }; Index: gcc/cselib.h =================================================================== --- gcc/cselib.h (revision 167283) +++ gcc/cselib.h (working copy) @@ -20,7 +20,7 @@ . */ /* Describe a value. */ -typedef struct GTY(()) cselib_val_struct { +typedef struct cselib_val_struct { /* The hash value. */ unsigned int hash; @@ -42,7 +42,7 @@ } cselib_val; /* A list of rtl expressions that hold the same value. */ -struct GTY(()) elt_loc_list { +struct elt_loc_list { /* Next element in the list. */ struct elt_loc_list *next; /* An rtl expression that holds the value. */ @@ -52,7 +52,7 @@ }; /* A list of cselib_val structures. */ -struct GTY(()) elt_list { +struct elt_list { struct elt_list *next; cselib_val *elt; }; Index: gcc/varasm.c =================================================================== --- gcc/varasm.c (revision 167283) +++ gcc/varasm.c (working copy) @@ -2541,7 +2541,7 @@ Store them both in the structure *VALUE. EXP must be reducible. */ -struct GTY(()) addr_const { +struct addr_const { rtx base; HOST_WIDE_INT offset; }; Index: gcc/tree-flow.h =================================================================== --- gcc/tree-flow.h (revision 167283) +++ gcc/tree-flow.h (working copy) @@ -289,7 +289,7 @@ /*--------------------------------------------------------------------------- Structure representing predictions in tree level. ---------------------------------------------------------------------------*/ -struct GTY((chain_next ("%h.ep_next"))) edge_prediction { +struct edge_prediction { struct edge_prediction *ep_next; edge ep_edge; enum br_predictor ep_predictor; @@ -303,8 +303,7 @@ /*--------------------------------------------------------------------------- Global declarations ---------------------------------------------------------------------------*/ -struct GTY(()) int_tree_map { - +struct int_tree_map { unsigned int uid; tree to; }; @@ -533,7 +532,7 @@ /* In tree-ssa.c */ /* Mapping for redirected edges. */ -struct GTY(()) _edge_var_map { +struct _edge_var_map { tree result; /* PHI result. */ tree def; /* PHI arg definition. */ source_location locus; /* PHI arg location. */