This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tuples] More GC fixes


Hi folks.

Here are a handful of fixes for GC related problems.

	- Get rid of GIMPLE_STATEMENT_LIST for now, since we have a GC
	  tag for gimple_stmt's, and the current STATEMENT_LIST business will
	  now work correctly for trees.

	- Change any references from common.base to base.  This more
	  accurately describes what's going on, since gimple_stmt's have
	  a base, but not a common.  This brings us to...

	- Add a TS_BASE tag to `union tree_node' so we can address tree->base
	  and have the GC machinery know what's going on.

	- Add a TS_GIMPLE_STATEMENT tag, and make gimple_stmt's part of
	  union tree_node.

	- Add a GTY((length)) descriptor for gimple_stmt so GTY can
	  know how many operands we have.

We're progressing quite nicely.  Now if I can figure out why my basic blocks
are getting corrupted, I could maybe get past buildling __divti3 ;-).

Committed to the branch.
Aldy

        * tree-into-ssa.c (REGISTER_DEFS_IN_STMT): Change common.base
	to base.
        * tree-tailcall.c (adjust_return_value): Same.
        * tree.c (tree_code_size): Remove GIMPLE_STATEMENT_LIST case.
        (copy_node_stat): Change common.base to base.
        (tree_node_structure): Return TS_GIMPLE_STATEMENT for tcc_gimple_stmt.
	Remove GIMPLE_STATEMENT_LIST case.
        * tree.h (struct gimple_stmt): Make operands of type tree.
	(TREE_CODE, TREE_SET_CODE, TREE_ADDRESSABLE, CALL_EXPR_TAILCALL,
	CASE_LOW_SEEN, TREE_STATIC, CLEANUP_EH_ONLY, CASE_HIGH_SEEN,
	TREE_NO_WARNING, TREE_CONSTANT_OVERFLOW, TREE_SYMBOL_REFERENCED,
	TYPE_REF_CAN_ALIAS_ALL, TREE_OVERFLOW, TREE_PUBLIC,
	TYPE_CACHED_VALUES_P, TREE_SIDE_EFFECTS, FORCED_LABEL,
	TREE_THIS_VOLATILE, TREE_THIS_NOTRAP, TREE_READONLY,
	TREE_CONSTANT, TYPE_SIZES_GIMPLIFIED, DECL_UNSIGNED,
	BIT_FIELD_REF_UNSIGNED, TYPE_UNSIGNED, TREE_ASM_WRITTEN, TREE_USED,
	TREE_NOTHROW, CALL_EXPR_RETURN_SLOT_OPT, DECL_BY_REFERENCE,
	CALL_FROM_THUNK_P, TYPE_ALIGN_OK, TREE_PRIVATE, TREE_PROTECTED,
	TREE_DEPRECATED, IDENTIFIER_TRANSPARENT_ALIAS, TREE_INVARIANT,
	TREE_LANG_FLAG_*, SSA_NAME_OCCURS_IN_ABNORMAL_PHI, 
	SSA_NAME_IN_FREE_LIST, TYPE_VOLATILE, TYPE_READONLY, BINFO_VIRTUAL_P):
	Change common.base to base.
	(GIMPLE_STATEMENT_LIST*): Remove.
	(union tree_node): Add base.  Remove gimple_statement_list.
	Remove pointer from gstmt.
        * tree-ssa-propagate.c (set_rhs): Change common.base to base.
        * treestruct.def: Add TS_BASE.  Remove TS_GIMPLE_STATEMENT_LIST.
        * tree-vn.c (vn_compute): Change common.base to base.
        * tree-eh.c (verify_eh_throw_stmt_node): Same.
        * tree-flow-inline.h (var_ann): Same.
        (function_ann): Same.
        (stmt_ann): Same.
        (mark_non_addressable): Same.
        * gimplify.c (tree_to_gimple_tuple): Same.
        * tree.def (DEFTREECODE): Remove GIMPLE_STATEMENT_LIST.
        * tree-dfa.c (create_var_ann): Change common.base to base.
        (create_function_ann): Same.
        (create_stmt_ann): Same.
        (create_tree_ann): Same.
        (collect_dfa_stats_r): Same.
        * tree-ssa-pre.c (NECESSARY): Change common.base to base.
        * tree-ssa-dce.c (NECESSARY): Same.
        * tree-ssa.c (delete_tree_ssa): Same.
        * tree-optimize.c (execute_free_cfg_annotations): Same.
        * tree-flow.h: Same.

Index: tree-into-ssa.c
===================================================================
--- tree-into-ssa.c	(revision 116725)
+++ tree-into-ssa.c	(working copy)
@@ -248,7 +248,7 @@ enum rewrite_mode {
    processed from those that only need to have their defs processed.
    Statements that define new SSA names only need to have their defs
    registered, but they don't need to have their uses renamed.  */
-#define REGISTER_DEFS_IN_THIS_STMT(T)	(T)->common.base.unsigned_flag
+#define REGISTER_DEFS_IN_THIS_STMT(T)	(T)->base.unsigned_flag
 
 
 /* Prototypes for debugging functions.  */
Index: tree-tailcall.c
===================================================================
--- tree-tailcall.c	(revision 116725)
+++ tree-tailcall.c	(working copy)
@@ -627,7 +627,7 @@ adjust_return_value (basic_block bb, tre
 
   if (TREE_CODE (ret_var) == GIMPLE_MODIFY_STMT)
     {
-      ret_var->common.base.ann = (tree_ann_t) stmt_ann (ret_stmt);
+      ret_var->base.ann = (tree_ann_t) stmt_ann (ret_stmt);
       bsi_replace (&bsi, ret_var, true);
       SSA_NAME_DEF_STMT (TREE_OPERAND (ret_var, 0)) = ret_var;
       ret_var = TREE_OPERAND (ret_var, 0);
Index: tree.c
===================================================================
--- tree.c	(revision 117063)
+++ tree.c	(working copy)
@@ -390,8 +390,6 @@ tree_code_size (enum tree_code code)
 	case SSA_NAME:		return sizeof (struct tree_ssa_name);
 
 	case STATEMENT_LIST:	return sizeof (struct tree_statement_list);
-	case GIMPLE_STATEMENT_LIST:
-	  return sizeof (struct gimple_statement_list);
 	case BLOCK:		return sizeof (struct tree_block);
 	case VALUE_HANDLE:	return sizeof (struct tree_value_handle);
 	case CONSTRUCTOR:	return sizeof (struct tree_constructor);
@@ -642,7 +640,7 @@ copy_node_stat (tree node MEM_STAT_DECL)
     TREE_CHAIN (t) = 0;
   TREE_ASM_WRITTEN (t) = 0;
   TREE_VISITED (t) = 0;
-  t->common.base.ann = 0;
+  t->base.ann = 0;
 
   if (TREE_CODE_CLASS (code) == tcc_declaration)
     {
@@ -2163,8 +2161,9 @@ tree_node_structure (tree t)
     case tcc_binary:
     case tcc_expression:
     case tcc_statement:
-    case tcc_gimple_stmt:
       return TS_EXP;
+    case tcc_gimple_stmt:
+      return TS_GIMPLE_STATEMENT;
     default:  /* tcc_constant and tcc_exceptional */
       break;
     }
@@ -2177,6 +2176,8 @@ tree_node_structure (tree t)
     case VECTOR_CST:		return TS_VECTOR;
     case STRING_CST:		return TS_STRING;
       /* tcc_exceptional cases.  */
+    /* FIXME tuples: eventually this should be TS_BASE.  For now, nothing
+       returns TS_BASE.  */
     case ERROR_MARK:		return TS_COMMON;
     case IDENTIFIER_NODE:	return TS_IDENTIFIER;
     case TREE_LIST:		return TS_LIST;
@@ -2185,8 +2186,6 @@ tree_node_structure (tree t)
     case SSA_NAME:		return TS_SSA_NAME;
     case PLACEHOLDER_EXPR:	return TS_COMMON;
     case STATEMENT_LIST:	return TS_STATEMENT_LIST;
-    case GIMPLE_STATEMENT_LIST:	return TS_GIMPLE_STATEMENT_LIST;
-    case GIMPLE_MODIFY_STMT:	return TS_GIMPLE_STATEMENT;
     case BLOCK:			return TS_BLOCK;
     case CONSTRUCTOR:		return TS_CONSTRUCTOR;
     case TREE_BINFO:		return TS_BINFO;
Index: tree.h
===================================================================
--- tree.h	(revision 117063)
+++ tree.h	(working copy)
@@ -403,7 +403,8 @@ struct gimple_stmt GTY(())
   tree block;
   struct gimple_stmt *prev;
   struct gimple_stmt *next;
-  struct tree_base *operands[1];
+  /* FIXME tuples: Eventually this should be of type ``struct gimple_expr''.  */
+  tree GTY ((length ("TREE_CODE_LENGTH (TREE_CODE (&%h))"))) operands[1];
 };
 
 /* The following table lists the uses of each of the above flags and
@@ -578,8 +579,8 @@ enum tree_node_structure_enum {
 
 /* The tree-code says what kind of node it is.
    Codes are defined in tree.def.  */
-#define TREE_CODE(NODE) ((enum tree_code) (NODE)->common.base.code)
-#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.base.code = (VALUE))
+#define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
+#define TREE_SET_CODE(NODE, VALUE) ((NODE)->base.code = (VALUE))
 
 /* When checking is enabled, errors will be generated if a tree node
    is accessed incorrectly. The macros die with a fatal error.  */
@@ -1092,18 +1093,18 @@ extern void omp_clause_range_check_faile
    object cannot go into register parameters, for example.
    In IDENTIFIER_NODEs, this means that some extern decl for this name
    had its address taken.  That matters for inline functions.  */
-#define TREE_ADDRESSABLE(NODE) ((NODE)->common.base.addressable_flag)
+#define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
 
 /* Set on a CALL_EXPR if the call is in a tail position, ie. just before the
    exit of a function.  Calls for which this is true are candidates for tail
    call optimizations.  */
 #define CALL_EXPR_TAILCALL(NODE) \
-  (CALL_EXPR_CHECK(NODE)->common.base.addressable_flag)
+  (CALL_EXPR_CHECK(NODE)->base.addressable_flag)
 
 /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
    CASE_LOW operand has been processed.  */
 #define CASE_LOW_SEEN(NODE) \
-  (CASE_LABEL_EXPR_CHECK (NODE)->common.base.addressable_flag)
+  (CASE_LABEL_EXPR_CHECK (NODE)->base.addressable_flag)
 
 /* In a VAR_DECL, nonzero means allocate static storage.
    In a FUNCTION_DECL, nonzero if function has been defined.
@@ -1111,63 +1112,63 @@ extern void omp_clause_range_check_faile
 
    ??? This is also used in lots of other nodes in unclear ways which
    should be cleaned up some day.  */
-#define TREE_STATIC(NODE) ((NODE)->common.base.static_flag)
+#define TREE_STATIC(NODE) ((NODE)->base.static_flag)
 
 /* In a TARGET_EXPR, WITH_CLEANUP_EXPR, means that the pertinent cleanup
    should only be executed if an exception is thrown, not on normal exit
    of its scope.  */
-#define CLEANUP_EH_ONLY(NODE) ((NODE)->common.base.static_flag)
+#define CLEANUP_EH_ONLY(NODE) ((NODE)->base.static_flag)
 
 /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
    CASE_HIGH operand has been processed.  */
 #define CASE_HIGH_SEEN(NODE) \
-  (CASE_LABEL_EXPR_CHECK (NODE)->common.base.static_flag)
+  (CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
 
 /* In an expr node (usually a conversion) this means the node was made
    implicitly and should not lead to any sort of warning.  In a decl node,
    warnings concerning the decl should be suppressed.  This is used at
    least for used-before-set warnings, and it set after one warning is
    emitted.  */
-#define TREE_NO_WARNING(NODE) ((NODE)->common.base.nowarning_flag)
+#define TREE_NO_WARNING(NODE) ((NODE)->base.nowarning_flag)
 
 /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST this means
    there was an overflow in folding.  This is distinct from
    TREE_OVERFLOW because ANSI C requires a diagnostic when overflows
    occur in constant expressions.  */
-#define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->common.base.static_flag)
+#define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->base.static_flag)
 
 /* In an IDENTIFIER_NODE, this means that assemble_name was called with
    this string as an argument.  */
 #define TREE_SYMBOL_REFERENCED(NODE) \
-  (IDENTIFIER_NODE_CHECK (NODE)->common.base.static_flag)
+  (IDENTIFIER_NODE_CHECK (NODE)->base.static_flag)
 
 /* Nonzero in a pointer or reference type means the data pointed to
    by this type can alias anything.  */
 #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
-  (PTR_OR_REF_CHECK (NODE)->common.base.static_flag)
+  (PTR_OR_REF_CHECK (NODE)->base.static_flag)
 
 /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
    there was an overflow in folding, and no warning has been issued
    for this subexpression.  TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW,
    but not vice versa.  */
 
-#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->common.base.public_flag)
+#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->base.public_flag)
 
 /* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
    nonzero means name is to be accessible from outside this module.
    In an IDENTIFIER_NODE, nonzero means an external declaration
    accessible from outside this module was previously seen
    for this name in an inner scope.  */
-#define TREE_PUBLIC(NODE) ((NODE)->common.base.public_flag)
+#define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)
 
 /* In a _TYPE, indicates whether TYPE_CACHED_VALUES contains a vector
    of cached values, or is something else.  */
-#define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->common.base.public_flag)
+#define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK(NODE)->base.public_flag)
 
 /* In a SAVE_EXPR, indicates that the original expression has already
    been substituted with a VAR_DECL that contains the value.  */
 #define SAVE_EXPR_RESOLVED_P(NODE) \
-  (TREE_CHECK (NODE, SAVE_EXPR)->common.base.public_flag)
+  (TREE_CHECK (NODE, SAVE_EXPR)->base.public_flag)
 
 /* In any expression, decl, or constant, nonzero means it has side effects or
    reevaluation of the whole expression could produce a different value.
@@ -1175,12 +1176,12 @@ extern void omp_clause_range_check_faile
    reference to a volatile variable.  In a ..._DECL, this is set only if the
    declaration said `volatile'.  This will never be set for a constant.  */
 #define TREE_SIDE_EFFECTS(NODE) \
-  (NON_TYPE_CHECK (NODE)->common.base.side_effects_flag)
+  (NON_TYPE_CHECK (NODE)->base.side_effects_flag)
 
 /* In a LABEL_DECL, nonzero means this label had its address taken
    and therefore can never be deleted and is a jump target for
    computed gotos.  */
-#define FORCED_LABEL(NODE) ((NODE)->common.base.side_effects_flag)
+#define FORCED_LABEL(NODE) ((NODE)->base.side_effects_flag)
 
 /* Nonzero means this expression is volatile in the C sense:
    its address should be of type `volatile WHATEVER *'.
@@ -1195,7 +1196,7 @@ extern void omp_clause_range_check_faile
    because eventually we may make that a different bit.
 
    If this bit is set in an expression, so is TREE_SIDE_EFFECTS.  */
-#define TREE_THIS_VOLATILE(NODE) ((NODE)->common.base.volatile_flag)
+#define TREE_THIS_VOLATILE(NODE) ((NODE)->base.volatile_flag)
 
 /* Nonzero means this node will not trap.  In an INDIRECT_REF, means
    accessing the memory pointed to won't generate a trap.  However,
@@ -1207,11 +1208,11 @@ extern void omp_clause_range_check_faile
    (or slice of the array) always belongs to the range of the array.
    I.e. that the access will not trap, provided that the access to
    the base to the array will not trap.  */
-#define TREE_THIS_NOTRAP(NODE) ((NODE)->common.base.nothrow_flag)
+#define TREE_THIS_NOTRAP(NODE) ((NODE)->base.nothrow_flag)
 
 /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
    nonzero means it may not be the lhs of an assignment.  */
-#define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->common.base.readonly_flag)
+#define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)
 
 /* Nonzero if NODE is a _DECL with TREE_READONLY set.  */
 #define TREE_READONLY_DECL_P(NODE)\
@@ -1219,22 +1220,22 @@ extern void omp_clause_range_check_faile
 
 /* Value of expression is constant.  Always on in all ..._CST nodes.  May
    also appear in an expression or decl where the value is constant.  */
-#define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->common.base.constant_flag)
+#define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->base.constant_flag)
 
 /* Nonzero if NODE, a type, has had its sizes gimplified.  */
 #define TYPE_SIZES_GIMPLIFIED(NODE) \
-  (TYPE_CHECK (NODE)->common.base.constant_flag)
+  (TYPE_CHECK (NODE)->base.constant_flag)
 
 /* In a decl (most significantly a FIELD_DECL), means an unsigned field.  */
 #define DECL_UNSIGNED(NODE) \
-  (DECL_COMMON_CHECK (NODE)->common.base.unsigned_flag)
+  (DECL_COMMON_CHECK (NODE)->base.unsigned_flag)
 
 /* In a BIT_FIELD_REF, means the bitfield is to be interpreted as unsigned.  */
 #define BIT_FIELD_REF_UNSIGNED(NODE) \
-  (BIT_FIELD_REF_CHECK (NODE)->common.base.unsigned_flag)
+  (BIT_FIELD_REF_CHECK (NODE)->base.unsigned_flag)
 
 /* In integral and pointer types, means an unsigned type.  */
-#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.base.unsigned_flag)
+#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.unsigned_flag)
 
 #define TYPE_TRAP_SIGNED(NODE) \
   (flag_trapv && ! TYPE_UNSIGNED (NODE))
@@ -1248,32 +1249,32 @@ extern void omp_clause_range_check_faile
    In a BLOCK node, nonzero if reorder_blocks has already seen this block.
    In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
    PHI node.  */
-#define TREE_ASM_WRITTEN(NODE) ((NODE)->common.base.asm_written_flag)
+#define TREE_ASM_WRITTEN(NODE) ((NODE)->base.asm_written_flag)
 
 /* Nonzero in a _DECL if the name is used in its scope.
    Nonzero in an expr node means inhibit warning if value is unused.
    In IDENTIFIER_NODEs, this means that some extern decl for this name
    was used.
    In a BLOCK, this means that the block contains variables that are used.  */
-#define TREE_USED(NODE) ((NODE)->common.base.used_flag)
+#define TREE_USED(NODE) ((NODE)->base.used_flag)
 
 /* In a FUNCTION_DECL, nonzero means a call to the function cannot throw
    an exception.  In a CALL_EXPR, nonzero means the call cannot throw.  */
-#define TREE_NOTHROW(NODE) ((NODE)->common.base.nothrow_flag)
+#define TREE_NOTHROW(NODE) ((NODE)->base.nothrow_flag)
 
 /* In a CALL_EXPR, means that it's safe to use the target of the call
    expansion as the return slot for a call that returns in memory.  */
-#define CALL_EXPR_RETURN_SLOT_OPT(NODE) ((NODE)->common.base.private_flag)
+#define CALL_EXPR_RETURN_SLOT_OPT(NODE) ((NODE)->base.private_flag)
 
 /* In a RESULT_DECL or PARM_DECL, means that it is passed by invisible
    reference (and the TREE_TYPE is a pointer to the true type).  */
 #define DECL_BY_REFERENCE(NODE) \
-  (DECL_COMMON_CHECK (NODE)->common.base.private_flag)
+  (DECL_COMMON_CHECK (NODE)->base.private_flag)
 
 /* In a CALL_EXPR, means that the call is the jump from a thunk to the
    thunked-to function.  */
 #define CALL_FROM_THUNK_P(NODE) \
-  (CALL_EXPR_CHECK (NODE)->common.base.protected_flag)
+  (CALL_EXPR_CHECK (NODE)->base.protected_flag)
 
 /* In a type, nonzero means that all objects of the type are guaranteed by the
    language or front-end to be properly aligned, so we can indicate that a MEM
@@ -1284,38 +1285,38 @@ extern void omp_clause_range_check_faile
 
    In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
    freelist.  */
-#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->common.base.nothrow_flag)
+#define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
 
 /* Used in classes in C++.  */
-#define TREE_PRIVATE(NODE) ((NODE)->common.base.private_flag)
+#define TREE_PRIVATE(NODE) ((NODE)->base.private_flag)
 /* Used in classes in C++.
    In a BLOCK node, this is BLOCK_HANDLER_BLOCK.  */
-#define TREE_PROTECTED(NODE) ((NODE)->common.base.protected_flag)
+#define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
 
 /* Nonzero in a _DECL if the use of the name is defined as a
    deprecated feature by __attribute__((deprecated)).  */
 #define TREE_DEPRECATED(NODE) \
-  ((NODE)->common.base.deprecated_flag)
+  ((NODE)->base.deprecated_flag)
 
 /* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
    uses are to be substituted for uses of the TREE_CHAINed identifier.  */
 #define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
-  (IDENTIFIER_NODE_CHECK (NODE)->common.base.deprecated_flag)
+  (IDENTIFIER_NODE_CHECK (NODE)->base.deprecated_flag)
 
 /* Value of expression is function invariant.  A strict subset of
    TREE_CONSTANT, such an expression is constant over any one function
    invocation, though not across different invocations.  May appear in
    any expression node.  */
-#define TREE_INVARIANT(NODE) ((NODE)->common.base.invariant_flag)
+#define TREE_INVARIANT(NODE) ((NODE)->base.invariant_flag)
 
 /* These flags are available for each language front end to use internally.  */
-#define TREE_LANG_FLAG_0(NODE) ((NODE)->common.base.lang_flag_0)
-#define TREE_LANG_FLAG_1(NODE) ((NODE)->common.base.lang_flag_1)
-#define TREE_LANG_FLAG_2(NODE) ((NODE)->common.base.lang_flag_2)
-#define TREE_LANG_FLAG_3(NODE) ((NODE)->common.base.lang_flag_3)
-#define TREE_LANG_FLAG_4(NODE) ((NODE)->common.base.lang_flag_4)
-#define TREE_LANG_FLAG_5(NODE) ((NODE)->common.base.lang_flag_5)
-#define TREE_LANG_FLAG_6(NODE) ((NODE)->common.base.lang_flag_6)
+#define TREE_LANG_FLAG_0(NODE) ((NODE)->base.lang_flag_0)
+#define TREE_LANG_FLAG_1(NODE) ((NODE)->base.lang_flag_1)
+#define TREE_LANG_FLAG_2(NODE) ((NODE)->base.lang_flag_2)
+#define TREE_LANG_FLAG_3(NODE) ((NODE)->base.lang_flag_3)
+#define TREE_LANG_FLAG_4(NODE) ((NODE)->base.lang_flag_4)
+#define TREE_LANG_FLAG_5(NODE) ((NODE)->base.lang_flag_5)
+#define TREE_LANG_FLAG_6(NODE) ((NODE)->base.lang_flag_6)
 
 /* Define additional fields and accessors for nodes representing constants.  */
 
@@ -1737,13 +1738,13 @@ struct tree_exp GTY(())
    never output, so we can safely use the ASM_WRITTEN_FLAG for this
    status bit.  */
 #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
-    SSA_NAME_CHECK (NODE)->common.base.asm_written_flag
+    SSA_NAME_CHECK (NODE)->base.asm_written_flag
 
 /* Nonzero if this SSA_NAME expression is currently on the free list of
    SSA_NAMES.  Using NOTHROW_FLAG seems reasonably safe since throwing
    has no meaning for an SSA_NAME.  */
 #define SSA_NAME_IN_FREE_LIST(NODE) \
-    SSA_NAME_CHECK (NODE)->common.base.nothrow_flag
+    SSA_NAME_CHECK (NODE)->base.nothrow_flag
 
 /* Attributes for SSA_NAMEs for pointer-type variables.  */
 #define SSA_NAME_PTR_INFO(N) \
@@ -2049,10 +2050,10 @@ struct tree_block GTY(())
   (FUNCTION_TYPE_CHECK (NODE)->type.no_force_blk_flag)
 
 /* Nonzero in a type considered volatile as a whole.  */
-#define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->common.base.volatile_flag)
+#define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
 
 /* Means this type is const-qualified.  */
-#define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->common.base.readonly_flag)
+#define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->base.readonly_flag)
 
 /* If nonzero, this type is `restrict'-qualified, in the C sense of
    the term.  */
@@ -2084,7 +2085,7 @@ struct tree_block GTY(())
 
 /* Used to keep track of visited nodes in tree traversals.  This is set to
    0 by copy_node and make_node.  */
-#define TREE_VISITED(NODE) ((NODE)->common.base.visited)
+#define TREE_VISITED(NODE) ((NODE)->base.visited)
 
 /* If set in an ARRAY_TYPE, indicates a string type (for languages
    that distinguish string from array of char).
@@ -2201,7 +2202,7 @@ struct tree_type GTY(())
 /* BINFO specific flags.  */
 
 /* Nonzero means that the derivation chain is via a `virtual' declaration.  */
-#define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->common.base.static_flag)
+#define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->base.static_flag)
 
 /* Flags for language dependent use.  */
 #define BINFO_MARKED(NODE) TREE_LANG_FLAG_0(TREE_BINFO_CHECK(NODE))
@@ -3159,7 +3160,7 @@ struct tree_type_decl GTY(())
 
 };
 
-/* A STATEMENT_LIST chains statements together in GENERIC.
+/* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
    To reduce overhead, the nodes containing the statements are not trees.
    This avoids the overhead of tree_common on all linked list elements.
 
@@ -3186,22 +3187,6 @@ struct tree_statement_list
   struct tree_statement_list_node *tail;
 };
 
-/* A GIMPLE_STATEMENT_LIST is similar to STATEMENT_LIST but for GIMPLE
-   statements.  */
-
-#define GIMPLE_STATEMENT_LIST_HEAD(NODE) \
-  (GIMPLE_STATEMENT_LIST_CHECK (NODE)->gimple_stmt_list.head)
-#define GIMPLE_STATEMENT_LIST_TAIL(NODE) \
-  (GIMPLE_STATEMENT_LIST_CHECK (NODE)->gimple_stmt_list.tail)
-
-struct gimple_statement_list
-  GTY(())
-{
-  struct tree_common common;
-  struct gimple_stmt *head;
-  struct gimple_stmt *tail;
-};
-
 #define VALUE_HANDLE_ID(NODE)		\
   (VALUE_HANDLE_CHECK (NODE)->value_handle.id)
 
@@ -3237,6 +3222,7 @@ struct tree_value_handle GTY(())
 union tree_node GTY ((ptr_alias (union lang_tree_node),
 		      desc ("tree_node_structure (&%h)")))
 {
+  struct tree_base GTY ((tag ("TS_BASE"))) base;
   struct tree_common GTY ((tag ("TS_COMMON"))) common;
   struct tree_int_cst GTY ((tag ("TS_INT_CST"))) int_cst;
   struct tree_real_cst GTY ((tag ("TS_REAL_CST"))) real_cst;
@@ -3266,8 +3252,7 @@ union tree_node GTY ((ptr_alias (union l
   struct tree_block GTY ((tag ("TS_BLOCK"))) block;
   struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
   struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
-  struct gimple_statement_list GTY ((tag ("TS_GIMPLE_STATEMENT_LIST"))) gimple_stmt_list;
-  struct gimple_stmt * GTY ((tag ("TS_GIMPLE_STATEMENT"))) gstmt;
+  struct gimple_stmt GTY ((tag ("TS_GIMPLE_STATEMENT"))) gstmt;
   struct tree_value_handle GTY ((tag ("TS_VALUE_HANDLE"))) value_handle;
   struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
   struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
Index: tree-ssa-propagate.c
===================================================================
--- tree-ssa-propagate.c	(revision 116725)
+++ tree-ssa-propagate.c	(working copy)
@@ -634,7 +634,7 @@ set_rhs (tree *stmt_p, tree expr)
 	 effects, then replace *STMT_P with an empty statement.  */
       ann = stmt_ann (stmt);
       *stmt_p = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
-      (*stmt_p)->common.base.ann = (tree_ann_t) ann;
+      (*stmt_p)->base.ann = (tree_ann_t) ann;
 
       if (in_ssa_p
 	  && TREE_SIDE_EFFECTS (expr))
Index: treestruct.def
===================================================================
--- treestruct.def	(revision 117063)
+++ treestruct.def	(working copy)
@@ -28,6 +28,7 @@ Software Foundation, 51 Franklin Street,
    tree_node for garbage collection purposes, as well as specifying what structures
    contain what other structures in the tree_contains_struct array.  */
 	
+DEFTREESTRUCT(TS_BASE, "base")
 DEFTREESTRUCT(TS_COMMON, "common")
 DEFTREESTRUCT(TS_INT_CST, "integer cst")
 DEFTREESTRUCT(TS_REAL_CST, "real cst")
@@ -57,7 +58,6 @@ DEFTREESTRUCT(TS_PHI_NODE, "phi node")
 DEFTREESTRUCT(TS_BLOCK, "block")
 DEFTREESTRUCT(TS_BINFO, "binfo")
 DEFTREESTRUCT(TS_STATEMENT_LIST, "statement list")
-DEFTREESTRUCT(TS_GIMPLE_STATEMENT_LIST, "gimple statement list")
 DEFTREESTRUCT(TS_GIMPLE_STATEMENT, "gimple statement")
 DEFTREESTRUCT(TS_VALUE_HANDLE, "value handle")
 DEFTREESTRUCT(TS_CONSTRUCTOR, "constructor")
Index: tree-vn.c
===================================================================
--- tree-vn.c	(revision 116725)
+++ tree-vn.c	(working copy)
@@ -85,8 +85,8 @@ vn_compute (tree expr, hashval_t val)
   /* EXPR must not be a statement.  We are only interested in value
      numbering expressions on the RHS of assignments.  */
   gcc_assert (expr);
-  gcc_assert (!expr->common.base.ann
-	      || expr->common.base.ann->common.type != STMT_ANN);
+  gcc_assert (!expr->base.ann
+	      || expr->base.ann->common.type != STMT_ANN);
 
   val = iterative_hash_expr (expr, val);
   return val;
Index: tree-eh.c
===================================================================
--- tree-eh.c	(revision 116725)
+++ tree-eh.c	(working copy)
@@ -2084,7 +2084,7 @@ verify_eh_throw_stmt_node (void **slot, 
 {
   struct throw_stmt_node *node = (struct throw_stmt_node *)*slot;
 
-  gcc_assert (node->stmt->common.base.ann == NULL);
+  gcc_assert (node->stmt->base.ann == NULL);
   return 1;
 }
 
Index: tree-flow-inline.h
===================================================================
--- tree-flow-inline.h	(revision 116725)
+++ tree-flow-inline.h	(working copy)
@@ -127,10 +127,10 @@ var_ann (tree t)
   gcc_assert (t);
   gcc_assert (DECL_P (t));
   gcc_assert (TREE_CODE (t) != FUNCTION_DECL);
-  gcc_assert (!t->common.base.ann
-	      || t->common.base.ann->common.type == VAR_ANN);
+  gcc_assert (!t->base.ann
+	      || t->base.ann->common.type == VAR_ANN);
 
-  return (var_ann_t) t->common.base.ann;
+  return (var_ann_t) t->base.ann;
 }
 
 /* Return the variable annotation for T, which must be a _DECL node.
@@ -149,10 +149,10 @@ function_ann (tree t)
 {
   gcc_assert (t);
   gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
-  gcc_assert (!t->common.base.ann
-	      || t->common.base.ann->common.type == FUNCTION_ANN);
+  gcc_assert (!t->base.ann
+	      || t->base.ann->common.type == FUNCTION_ANN);
 
-  return (function_ann_t) t->common.base.ann;
+  return (function_ann_t) t->base.ann;
 }
 
 /* Return the function annotation for T, which must be a FUNCTION_DECL node.
@@ -172,7 +172,7 @@ stmt_ann (tree t)
 #ifdef ENABLE_CHECKING
   gcc_assert (is_gimple_stmt (t));
 #endif
-  return (stmt_ann_t) t->common.base.ann;
+  return (stmt_ann_t) t->base.ann;
 }
 
 /* Return the statement annotation for T, which must be a statement
@@ -790,7 +790,7 @@ mark_non_addressable (tree var)
 static inline tree_ann_t
 tree_ann (tree t)
 {
-  return t->common.base.ann;
+  return t->base.ann;
 }
 
 /* Return a common annotation for T.  Create the constant annotation if it
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 116725)
+++ gimplify.c	(working copy)
@@ -3521,7 +3521,7 @@ tree_to_gimple_tuple (tree *tp)
 	  }
 
         gs = TREE_TO_GIMPLE_STMT (make_node (GIMPLE_MODIFY_STMT));
-        gs->base = (*tp)->common.base;
+        gs->base = (*tp)->base;
         /* The set to base above overwrites the CODE.  */
         TREE_SET_CODE ((tree) gs, GIMPLE_MODIFY_STMT);
 
Index: tree.def
===================================================================
--- tree.def	(revision 117063)
+++ tree.def	(working copy)
@@ -896,9 +896,6 @@ DEFTREECODE (POLYNOMIAL_CHREC, "polynomi
    Use the interface in tree-iterator.h to access this node.  */
 DEFTREECODE (STATEMENT_LIST, "statement_list", tcc_exceptional, 0)
 
-/* Similarly for gimple statements.  */
-DEFTREECODE (GIMPLE_STATEMENT_LIST, "gimple_statement_list", tcc_exceptional, 0)
-
 /* Value handles.  Artificial nodes to represent expressions in
    partial redundancy elimination (tree-ssa-pre.c).  These nodes are
    used for expression canonicalization.  If two expressions compute
Index: tree-dfa.c
===================================================================
--- tree-dfa.c	(revision 116725)
+++ tree-dfa.c	(working copy)
@@ -140,15 +140,15 @@ create_var_ann (tree t)
 
   gcc_assert (t);
   gcc_assert (DECL_P (t));
-  gcc_assert (!t->common.base.ann
-      || t->common.base.ann->common.type == VAR_ANN);
+  gcc_assert (!t->base.ann
+      || t->base.ann->common.type == VAR_ANN);
 
   ann = GGC_NEW (struct var_ann_d);
   memset ((void *) ann, 0, sizeof (*ann));
 
   ann->common.type = VAR_ANN;
 
-  t->common.base.ann = (tree_ann_t) ann;
+  t->base.ann = (tree_ann_t) ann;
 
   return ann;
 }
@@ -162,15 +162,15 @@ create_function_ann (tree t)
 
   gcc_assert (t);
   gcc_assert (TREE_CODE (t) == FUNCTION_DECL);
-  gcc_assert (!t->common.base.ann
-      || t->common.base.ann->common.type == FUNCTION_ANN);
+  gcc_assert (!t->base.ann
+      || t->base.ann->common.type == FUNCTION_ANN);
 
   ann = ggc_alloc (sizeof (*ann));
   memset ((void *) ann, 0, sizeof (*ann));
 
   ann->common.type = FUNCTION_ANN;
 
-  t->common.base.ann = (tree_ann_t) ann;
+  t->base.ann = (tree_ann_t) ann;
 
   return ann;
 }
@@ -183,8 +183,8 @@ create_stmt_ann (tree t)
   stmt_ann_t ann;
 
   gcc_assert (is_gimple_stmt (t));
-  gcc_assert (!t->common.base.ann
-      || t->common.base.ann->common.type == STMT_ANN);
+  gcc_assert (!t->base.ann
+      || t->base.ann->common.type == STMT_ANN);
 
   ann = GGC_NEW (struct stmt_ann_d);
   memset ((void *) ann, 0, sizeof (*ann));
@@ -194,7 +194,7 @@ create_stmt_ann (tree t)
   /* Since we just created the annotation, mark the statement modified.  */
   ann->modified = true;
 
-  t->common.base.ann = (tree_ann_t) ann;
+  t->base.ann = (tree_ann_t) ann;
 
   return ann;
 }
@@ -207,14 +207,14 @@ create_tree_ann (tree t)
   tree_ann_t ann;
 
   gcc_assert (t);
-  gcc_assert (!t->common.base.ann
-      || t->common.base.ann->common.type == TREE_ANN_COMMON);
+  gcc_assert (!t->base.ann
+      || t->base.ann->common.type == TREE_ANN_COMMON);
 
   ann = GGC_NEW (union tree_ann_d);
   memset ((void *) ann, 0, sizeof (*ann));
 
   ann->common.type = TREE_ANN_COMMON;
-  t->common.base.ann = ann;
+  t->base.ann = ann;
 
   return ann;
 }
@@ -559,9 +559,9 @@ collect_dfa_stats_r (tree *tp, int *walk
   tree t = *tp;
   struct dfa_stats_d *dfa_stats_p = (struct dfa_stats_d *)data;
 
-  if (t->common.base.ann)
+  if (t->base.ann)
     {
-      switch (ann_type (t->common.base.ann))
+      switch (ann_type (t->base.ann))
 	{
 	case STMT_ANN:
 	  {
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c	(revision 116725)
+++ tree-ssa-pre.c	(working copy)
@@ -2282,7 +2282,7 @@ find_or_generate_expression (basic_block
   return genop;
 }
 
-#define NECESSARY(stmt)		stmt->common.base.asm_written_flag
+#define NECESSARY(stmt)		stmt->base.asm_written_flag
 /* Create an expression in pieces, so that we can handle very complex
    expressions that may be ANTIC, but not necessary GIMPLE.
    BLOCK is the basic block the expression will be inserted into,
Index: tree-ssa-dce.c
===================================================================
--- tree-ssa-dce.c	(revision 116725)
+++ tree-ssa-dce.c	(working copy)
@@ -216,7 +216,7 @@ find_pdom (basic_block block)
     }
 }
 
-#define NECESSARY(stmt)		stmt->common.base.asm_written_flag
+#define NECESSARY(stmt)		stmt->base.asm_written_flag
 
 /* If STMT is not already marked necessary, mark it, and add it to the
    worklist if ADD_TO_WORKLIST is true.  */
Index: tree-ssa.c
===================================================================
--- tree-ssa.c	(revision 116725)
+++ tree-ssa.c	(working copy)
@@ -884,8 +884,8 @@ delete_tree_ssa (void)
   /* Remove annotations from every referenced variable.  */
   FOR_EACH_REFERENCED_VAR (var, rvi)
     {
-      ggc_free (var->common.base.ann);
-      var->common.base.ann = NULL;
+      ggc_free (var->base.ann);
+      var->base.ann = NULL;
     }
   htab_delete (referenced_vars);
   referenced_vars = NULL;
Index: tree-optimize.c
===================================================================
--- tree-optimize.c	(revision 116725)
+++ tree-optimize.c	(working copy)
@@ -206,8 +206,8 @@ execute_free_cfg_annotations (void)
     for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
       {
 	tree stmt = bsi_stmt (bsi);
-	ggc_free (stmt->common.base.ann);
-	stmt->common.base.ann = NULL;
+	ggc_free (stmt->base.ann);
+	stmt->base.ann = NULL;
       }
 
   /* And get rid of annotations we no longer need.  */
Index: tree-flow.h
===================================================================
--- tree-flow.h	(revision 116725)
+++ tree-flow.h	(working copy)
@@ -99,7 +99,7 @@ struct ptr_info_def GTY(())
 
 
 /*---------------------------------------------------------------------------
-		   Tree annotations stored in tree_common.base.ann
+		   Tree annotations stored in tree_base.ann
 ---------------------------------------------------------------------------*/
 enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN, STMT_ANN };


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]