diff options
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 347 |
1 files changed, 133 insertions, 214 deletions
diff --git a/gcc/tree.h b/gcc/tree.h index d4af777962b..5f5b37d4ef8 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "vec.h" #include "double-int.h" #include "alias.h" +#include "options.h" /* Codes of tree nodes */ @@ -68,8 +69,7 @@ enum tree_code_class { but usually no interesting value. */ tcc_vl_exp, /* A function call or other expression with a variable-length operand vector. */ - tcc_expression, /* Any other expression. */ - tcc_gimple_stmt /* A GIMPLE statement. */ + tcc_expression /* Any other expression. */ }; /* Each tree code class has an associated string representation. @@ -173,32 +173,10 @@ extern const enum tree_code_class tree_code_type[]; #define IS_EXPR_CODE_CLASS(CLASS)\ ((CLASS) >= tcc_reference && (CLASS) <= tcc_expression) -/* Returns nonzero iff CLASS is a GIMPLE statement. */ - -#define IS_GIMPLE_STMT_CODE_CLASS(CLASS) ((CLASS) == tcc_gimple_stmt) - /* Returns nonzero iff NODE is an expression of some kind. */ #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE))) -/* Returns nonzero iff NODE is an OpenMP directive. */ - -#define OMP_DIRECTIVE_P(NODE) \ - (TREE_CODE (NODE) == OMP_PARALLEL \ - || TREE_CODE (NODE) == OMP_TASK \ - || TREE_CODE (NODE) == OMP_FOR \ - || TREE_CODE (NODE) == OMP_SECTIONS \ - || TREE_CODE (NODE) == OMP_SECTIONS_SWITCH \ - || TREE_CODE (NODE) == OMP_SINGLE \ - || TREE_CODE (NODE) == OMP_SECTION \ - || TREE_CODE (NODE) == OMP_MASTER \ - || TREE_CODE (NODE) == OMP_ORDERED \ - || TREE_CODE (NODE) == OMP_CRITICAL \ - || TREE_CODE (NODE) == OMP_RETURN \ - || TREE_CODE (NODE) == OMP_ATOMIC_LOAD \ - || TREE_CODE (NODE) == OMP_ATOMIC_STORE \ - || TREE_CODE (NODE) == OMP_CONTINUE) - /* Number of argument-words in each kind of tree-node. */ extern const unsigned char tree_code_length[]; @@ -406,8 +384,6 @@ struct tree_base GTY(()) unsigned spare : 23; - /* FIXME tuples: Eventually, we need to move this somewhere external to - the trees. */ union tree_ann_d *ann; }; @@ -418,16 +394,6 @@ struct tree_common GTY(()) tree type; }; -/* GIMPLE_MODIFY_STMT */ -struct gimple_stmt GTY(()) -{ - struct tree_base base; - location_t locus; - tree block; - /* 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 for which types of nodes they are defined. @@ -476,7 +442,7 @@ struct gimple_stmt GTY(()) POINTER_TYPE, REFERENCE_TYPE MOVE_NONTEMPORAL in - GIMPLE_MODIFY_STMT + MODIFY_EXPR CASE_HIGH_SEEN in CASE_LABEL_EXPR @@ -522,9 +488,6 @@ struct gimple_stmt GTY(()) DECL_BY_REFERENCE in PARM_DECL, RESULT_DECL - OMP_RETURN_NOWAIT in - OMP_RETURN - OMP_SECTION_LAST in OMP_SECTION @@ -814,14 +777,6 @@ enum tree_node_structure_enum { __FUNCTION__); \ __t; }) -#define GIMPLE_STMT_CHECK(T) __extension__ \ -({ __typeof (T) const __t = (T); \ - char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \ - if (!IS_GIMPLE_STMT_CODE_CLASS (__c)) \ - tree_class_check_failed (__t, tcc_gimple_stmt, __FILE__, __LINE__,\ - __FUNCTION__); \ - __t; }) - /* These checks have to be special cased. */ #define NON_TYPE_CHECK(T) __extension__ \ ({ __typeof (T) const __t = (T); \ @@ -841,17 +796,6 @@ enum tree_node_structure_enum { __FILE__, __LINE__, __FUNCTION__); \ &__t->vec.a[__i]; })) -#define PHI_NODE_ELT_CHECK(T, I) __extension__ \ -(*({__typeof (T) const __t = (T); \ - const int __i = (I); \ - if (TREE_CODE (__t) != PHI_NODE) \ - tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \ - PHI_NODE, 0); \ - if (__i < 0 || __i >= __t->phi.capacity) \ - phi_node_elt_check_failed (__i, __t->phi.num_args, \ - __FILE__, __LINE__, __FUNCTION__); \ - &__t->phi.a[__i]; })) - #define OMP_CLAUSE_ELT_CHECK(T, I) __extension__ \ (*({__typeof (T) const __t = (T); \ const int __i = (I); \ @@ -867,8 +811,6 @@ enum tree_node_structure_enum { #define TREE_OPERAND_CHECK(T, I) __extension__ \ (*({__typeof (T) const __t = EXPR_CHECK (T); \ const int __i = (I); \ - if (GIMPLE_TUPLE_P (__t)) \ - gcc_unreachable (); \ if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \ tree_operand_check_failed (__i, __t, \ __FILE__, __LINE__, __FUNCTION__); \ @@ -884,15 +826,6 @@ enum tree_node_structure_enum { __FILE__, __LINE__, __FUNCTION__); \ &__t->exp.operands[__i]; })) -/* Special checks for GIMPLE_STMT_OPERANDs. */ -#define GIMPLE_STMT_OPERAND_CHECK(T, I) __extension__ \ -(*({__typeof (T) const __t = GIMPLE_STMT_CHECK (T); \ - const int __i = (I); \ - if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \ - tree_operand_check_failed (__i, __t, \ - __FILE__, __LINE__, __FUNCTION__); \ - &__t->gstmt.operands[__i]; })) - #define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \ (*(rtx *) \ ({__typeof (T) const __t = (T); \ @@ -915,8 +848,6 @@ enum tree_node_structure_enum { #define TREE_CHAIN(NODE) __extension__ \ (*({__typeof (NODE) const __t = (NODE); \ - if (GIMPLE_TUPLE_P (__t)) \ - gcc_unreachable (); \ &__t->common.chain; })) /* In all nodes that are expressions, this is the data type of the expression. @@ -925,8 +856,6 @@ enum tree_node_structure_enum { In VECTOR_TYPE nodes, this is the type of the elements. */ #define TREE_TYPE(NODE) __extension__ \ (*({__typeof (NODE) const __t = (NODE); \ - if (GIMPLE_TUPLE_P (__t)) \ - gcc_unreachable (); \ &__t->common.type; })) extern void tree_contains_struct_check_failed (const_tree, @@ -984,14 +913,11 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, #define TREE_CLASS_CHECK(T, CODE) (T) #define TREE_RANGE_CHECK(T, CODE1, CODE2) (T) #define EXPR_CHECK(T) (T) -#define GIMPLE_STMT_CHECK(T) (T) #define NON_TYPE_CHECK(T) (T) #define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I]) #define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I]) #define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I]) -#define GIMPLE_STMT_OPERAND_CHECK(T, I) ((T)->gstmt.operands[I]) #define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I])) -#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i]) #define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i]) #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T) #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T) @@ -1027,27 +953,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \ FIXED_POINT_TYPE) -/* Nonzero if NODE is a GIMPLE statement. */ -#define GIMPLE_STMT_P(NODE) \ - (TREE_CODE_CLASS (TREE_CODE ((NODE))) == tcc_gimple_stmt) - -/* Nonzero if NODE is a GIMPLE tuple. */ -#define GIMPLE_TUPLE_P(NODE) (GIMPLE_STMT_P (NODE) || TREE_CODE (NODE) == PHI_NODE) - -/* A GIMPLE tuple that has a ``locus'' field. */ -#define GIMPLE_TUPLE_HAS_LOCUS_P(NODE) GIMPLE_STMT_P ((NODE)) - -/* Like TREE_OPERAND but works with GIMPLE stmt tuples as well. - - If you know the NODE is a GIMPLE statement, use GIMPLE_STMT_OPERAND. If the - NODE code is unknown at compile time, use this macro. */ -#define GENERIC_TREE_OPERAND(NODE, I) *(generic_tree_operand ((NODE), (I))) - -/* Like TREE_TYPE but returns void_type_node for gimple tuples that have - no type. */ - -#define GENERIC_TREE_TYPE(NODE) *(generic_tree_type ((NODE))) - /* Here is how primitive or already-canonicalized types' hash codes are made. */ #define TYPE_HASH(TYPE) (TYPE_UID (TYPE)) @@ -1056,16 +961,12 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, used in hash tables which are saved to a PCH. */ #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777) -/* The TREE_CHAIN but it is able to handle tuples. */ -#define GENERIC_NEXT(NODE) \ - (TREE_CODE (NODE) == PHI_NODE ? PHI_CHAIN (NODE) : \ - GIMPLE_STMT_P (NODE) ? NULL_TREE : TREE_CHAIN (NODE)) - -/* Tests if expression is conversion expr (NOP_EXPRs or CONVERT_EXPRs). */ +/* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */ +#define IS_CONVERT_EXPR_CODE_P(CODE) \ + ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR) -#define CONVERT_EXPR_P(EXP) \ - (TREE_CODE (EXP) == NOP_EXPR \ - || TREE_CODE (EXP) == CONVERT_EXPR) +/* Similarly, but accept an expressions instead of a tree code. */ +#define CONVERT_EXPR_P(EXP) IS_CONVERT_EXPR_CODE_P (TREE_CODE (EXP)) /* Generate case for NOP_EXPR, CONVERT_EXPR. */ @@ -1081,7 +982,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, || TREE_CODE (EXP) == NON_LVALUE_EXPR) \ && TREE_OPERAND (EXP, 0) != error_mark_node \ && (TYPE_MODE (TREE_TYPE (EXP)) \ - == TYPE_MODE (GENERIC_TREE_TYPE (TREE_OPERAND (EXP, 0))))) \ + == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \ (EXP) = TREE_OPERAND (EXP, 0) /* Like STRIP_NOPS, but don't let the signedness change either. */ @@ -1278,7 +1179,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, /* In a MODIFY_EXPR, means that the store in the expression is nontemporal. */ #define MOVE_NONTEMPORAL(NODE) \ - (GIMPLE_MODIFY_STMT_CHECK (NODE)->base.static_flag) + (EXPR_CHECK (NODE)->base.static_flag) /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means there was an overflow in folding. */ @@ -1657,28 +1558,25 @@ struct tree_constructor GTY(()) #define VL_EXP_OPERAND_LENGTH(NODE) \ ((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0])) -/* In gimple statements. */ -#define GIMPLE_STMT_OPERAND(NODE, I) GIMPLE_STMT_OPERAND_CHECK (NODE, I) -#define GIMPLE_STMT_LOCUS(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.locus) -#define GIMPLE_STMT_BLOCK(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.block) - /* In a LOOP_EXPR node. */ #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0) /* The source location of this expression. Non-tree_exp nodes such as decls and constants can be shared among multiple locations, so return nothing. */ -#define EXPR_LOCATION(NODE) expr_location ((NODE)) -#define SET_EXPR_LOCATION(NODE, FROM) set_expr_location ((NODE), (FROM)) -#define EXPR_HAS_LOCATION(NODE) expr_has_location ((NODE)) -#define EXPR_LOCUS(NODE) expr_locus ((NODE)) +#define EXPR_LOCATION(NODE) (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION) +#define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS) +#define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION) +#define EXPR_LOCUS(NODE) (EXPR_P (NODE) \ + ? CONST_CAST (source_location *, &(NODE)->exp.locus) \ + : (source_location *) NULL) #define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM)) -#define EXPR_FILENAME(NODE) (expr_filename ((NODE))) -#define EXPR_LINENO(NODE) (expr_lineno ((NODE))) +#define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus) +#define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus) /* True if a tree is an expression or statement that can have a location. */ -#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE) || GIMPLE_STMT_P (NODE)) +#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE)) /* In a TARGET_EXPR node. */ #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0) @@ -1804,22 +1702,13 @@ struct tree_constructor GTY(()) #define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0) #define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1) -#define OMP_PARALLEL_FN(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 2) -#define OMP_PARALLEL_DATA_ARG(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 3) #define OMP_TASK_BODY(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 0) #define OMP_TASK_CLAUSES(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 1) -#define OMP_TASK_FN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 2) -#define OMP_TASK_DATA_ARG(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 3) -#define OMP_TASK_COPYFN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 4) -#define OMP_TASK_ARG_SIZE(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 5) -#define OMP_TASK_ARG_ALIGN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 6) #define OMP_TASKREG_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_TASK) #define OMP_TASKREG_BODY(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 0) #define OMP_TASKREG_CLAUSES(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 1) -#define OMP_TASKREG_FN(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 2) -#define OMP_TASKREG_DATA_ARG(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 3) #define OMP_FOR_BODY(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 0) #define OMP_FOR_CLAUSES(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 1) @@ -1830,7 +1719,6 @@ struct tree_constructor GTY(()) #define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0) #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1) -#define OMP_SECTIONS_CONTROL(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 2) #define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0) @@ -1855,13 +1743,6 @@ struct tree_constructor GTY(()) #define OMP_SECTION_LAST(NODE) \ (OMP_SECTION_CHECK (NODE)->base.private_flag) -/* True on an OMP_RETURN statement if the return does not require a - thread synchronization via some sort of barrier. The exact barrier - that would otherwise be emitted is dependent on the OMP statement - with which this return is associated. */ -#define OMP_RETURN_NOWAIT(NODE) \ - (OMP_RETURN_CHECK (NODE)->base.private_flag) - /* True on an OMP_PARALLEL statement if it represents an explicit combined parallel work-sharing constructs. */ #define OMP_PARALLEL_COMBINED(NODE) \ @@ -1886,6 +1767,8 @@ struct tree_constructor GTY(()) OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \ OMP_CLAUSE_LASTPRIVATE),\ 1) +#define OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ(NODE) \ + (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init #define OMP_CLAUSE_IF_EXPR(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0) @@ -1907,6 +1790,10 @@ struct tree_constructor GTY(()) OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1) #define OMP_CLAUSE_REDUCTION_MERGE(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2) +#define OMP_CLAUSE_REDUCTION_GIMPLE_INIT(NODE) \ + (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init +#define OMP_CLAUSE_REDUCTION_GIMPLE_MERGE(NODE) \ + (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_merge #define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \ OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3) @@ -1950,10 +1837,8 @@ struct tree_exp GTY(()) only field that can be relied upon. */ #define SSA_NAME_VAR(NODE) SSA_NAME_CHECK (NODE)->ssa_name.var -/* Returns the statement which defines this reference. Note that - we use the same field when chaining SSA_NAME nodes together on - the SSA_NAME freelist. */ -#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->common.chain +/* Returns the statement which defines this SSA name. */ +#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->ssa_name.def_stmt /* Returns the SSA version number of this SSA name. Note that in tree SSA, version numbers are not per variable and may be recycled. */ @@ -1999,7 +1884,12 @@ typedef struct ssa_use_operand_d GTY(()) { struct ssa_use_operand_d* GTY((skip(""))) prev; struct ssa_use_operand_d* GTY((skip(""))) next; - tree GTY((skip(""))) stmt; + /* Immediate uses for a given SSA name are maintained as a cyclic + list. To recognize the root of this list, the location field + needs to point to the original SSA name. Since statements and + SSA names are of different data types, we need this union. See + the explanation in struct immediate_use_iterator_d. */ + union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc; tree *GTY((skip(""))) use; } ssa_use_operand_t; @@ -2013,6 +1903,9 @@ struct tree_ssa_name GTY(()) /* _DECL wrapped by this SSA name. */ tree var; + /* Statement that defines this SSA name. */ + gimple def_stmt; + /* SSA version number. */ unsigned int version; @@ -2030,29 +1923,6 @@ struct tree_ssa_name GTY(()) struct ssa_use_operand_d imm_uses; }; -/* In a PHI_NODE node. */ - -/* These 2 macros should be considered off limits for use by developers. If - you wish to access the use or def fields of a PHI_NODE in the SSA - optimizers, use the accessor macros found in tree-ssa-operands.h. - These two macros are to be used only by those accessor macros, and other - select places where we *absolutely* must take the address of the tree. */ - -#define PHI_RESULT_TREE(NODE) PHI_NODE_CHECK (NODE)->phi.result -#define PHI_ARG_DEF_TREE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).def - -/* PHI_NODEs for each basic block are chained together in a single linked - list. The head of the list is linked from the block annotation, and - the link to the next PHI is in PHI_CHAIN. */ -#define PHI_CHAIN(NODE) PHI_NODE_CHECK (NODE)->phi.chain - -#define PHI_NUM_ARGS(NODE) PHI_NODE_CHECK (NODE)->phi.num_args -#define PHI_ARG_CAPACITY(NODE) PHI_NODE_CHECK (NODE)->phi.capacity -#define PHI_ARG_ELT(NODE, I) PHI_NODE_ELT_CHECK (NODE, I) -#define PHI_ARG_EDGE(NODE, I) (EDGE_PRED (PHI_BB ((NODE)), (I))) -#define PHI_BB(NODE) PHI_NODE_CHECK (NODE)->phi.bb -#define PHI_ARG_IMM_USE_NODE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).imm_use - struct phi_arg_d GTY(()) { /* imm_use MUST be the first element in struct because we do some @@ -2061,22 +1931,6 @@ struct phi_arg_d GTY(()) tree def; }; -struct tree_phi_node GTY(()) -{ - struct tree_base common; - tree chain; - tree result; - int num_args; - int capacity; - - /* Basic block holding this PHI node. */ - struct basic_block_def *bb; - - /* Arguments of the PHI node. These are maintained in the same - order as predecessor edge vector BB->PREDS. */ - struct phi_arg_d GTY ((length ("((tree)&%h)->phi.num_args"))) a[1]; -}; - #define OMP_CLAUSE_CODE(NODE) \ (OMP_CLAUSE_CHECK (NODE))->omp_clause.code @@ -2099,6 +1953,12 @@ struct tree_omp_clause GTY(()) enum omp_clause_schedule_kind schedule_kind; enum tree_code reduction_code; } GTY ((skip)) subcode; + + /* The gimplification of OMP_CLAUSE_REDUCTION_{INIT,MERGE} for omp-low's + usage. */ + gimple_seq gimple_reduction_init; + gimple_seq gimple_reduction_merge; + tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1]; }; @@ -3408,6 +3268,16 @@ struct tree_decl_non_common GTY(()) #define DECL_ARGUMENTS(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.arguments) #define DECL_ARGUMENT_FLD(NODE) (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.arguments) +/* In FUNCTION_DECL, the function specific target options to use when compiling + this function. */ +#define DECL_FUNCTION_SPECIFIC_TARGET(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_target) + +/* In FUNCTION_DECL, the function specific optimization options to use when + compiling this function. */ +#define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE) \ + (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_optimization) + /* FUNCTION_DECL inherits from DECL_NON_COMMON because of the use of the arguments/result/saved_tree fields by front ends. It was either inherit FUNCTION_DECL from non_common, or inherit non_common from FUNCTION_DECL, @@ -3419,6 +3289,10 @@ struct tree_function_decl GTY(()) struct function *f; + /* Function specific options that are used by this function. */ + tree function_specific_target; /* target options */ + tree function_specific_optimization; /* optimization options */ + /* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is DECL_FUNCTION_CODE. Otherwise unused. ??? The bitfield needs to be able to hold all target function @@ -3491,6 +3365,39 @@ struct tree_statement_list struct tree_statement_list_node *tail; }; + +/* Optimization options used by a function. */ + +struct tree_optimization_option GTY(()) +{ + struct tree_common common; + + /* The optimization options used by the user. */ + struct cl_optimization opts; +}; + +#define TREE_OPTIMIZATION(NODE) \ + (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts) + +/* Return a tree node that encapsulates the current optimization options. */ +extern tree build_optimization_node (void); + +/* Target options used by a function. */ + +struct tree_target_option GTY(()) +{ + struct tree_common common; + + /* The optimization options used by the user. */ + struct cl_target_option opts; +}; + +#define TREE_TARGET_OPTION(NODE) \ + (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts) + +/* Return a tree node that encapsulates the current target options. */ +extern tree build_target_option_node (void); + /* Define the overall contents of a tree node. It may be any of the structures declared above @@ -3526,15 +3433,15 @@ union tree_node GTY ((ptr_alias (union lang_tree_node), struct tree_vec GTY ((tag ("TS_VEC"))) vec; struct tree_exp GTY ((tag ("TS_EXP"))) exp; struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name; - struct tree_phi_node GTY ((tag ("TS_PHI_NODE"))) phi; 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_stmt GTY ((tag ("TS_GIMPLE_STATEMENT"))) gstmt; struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor; struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag; struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause; struct tree_memory_partition_tag GTY ((tag ("TS_MEMORY_PARTITION_TAG"))) mpt; + struct tree_optimization_option GTY ((tag ("TS_OPTIMIZATION"))) optimization; + struct tree_target_option GTY ((tag ("TS_TARGET_OPTION"))) target_option; }; /* Standard named or nameless data types of the C compiler. */ @@ -3682,6 +3589,15 @@ enum tree_index TI_SAT_UDA_TYPE, TI_SAT_UTA_TYPE, + TI_OPTIMIZATION_DEFAULT, + TI_OPTIMIZATION_CURRENT, + TI_OPTIMIZATION_COLD, + TI_OPTIMIZATION_HOT, + TI_TARGET_OPTION_DEFAULT, + TI_TARGET_OPTION_CURRENT, + TI_CURRENT_OPTION_PRAGMA, + TI_CURRENT_OPTIMIZE_PRAGMA, + TI_MAX }; @@ -3849,6 +3765,22 @@ extern GTY(()) tree global_trees[TI_MAX]; #define main_identifier_node global_trees[TI_MAIN_IDENTIFIER] #define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node) +/* Optimization options (OPTIMIZATION_NODE) to use for default, current, cold, + and hot functions. */ +#define optimization_default_node global_trees[TI_OPTIMIZATION_DEFAULT] +#define optimization_current_node global_trees[TI_OPTIMIZATION_CURRENT] +#define optimization_cold_node global_trees[TI_OPTIMIZATION_COLD] +#define optimization_hot_node global_trees[TI_OPTIMIZATION_HOT] + +/* Default/current target options (TARGET_OPTION_NODE). */ +#define target_option_default_node global_trees[TI_TARGET_OPTION_DEFAULT] +#define target_option_current_node global_trees[TI_TARGET_OPTION_CURRENT] + +/* Default tree list option(), optimize() pragmas to be linked into the + attribute list. */ +#define current_option_pragma global_trees[TI_CURRENT_OPTION_PRAGMA] +#define current_optimize_pragma global_trees[TI_CURRENT_OPTIMIZE_PRAGMA] + /* An enumeration of the standard C integer types. These must be ordered so that shorter types appear before longer ones, and so that signed types appear before unsigned ones, for the correct @@ -3931,8 +3863,8 @@ extern hashval_t decl_assembler_name_hash (const_tree asmname); extern size_t tree_size (const_tree); /* Compute the number of bytes occupied by a tree with code CODE. This - function cannot be used for TREE_VEC or PHI_NODE codes, which are of - variable length. */ + function cannot be used for TREE_VEC codes, which are of variable + length. */ extern size_t tree_code_size (enum tree_code); /* Lowest level primitive for allocating a node. @@ -4008,10 +3940,6 @@ extern tree build7_stat (enum tree_code, tree, tree, tree, tree, tree, #define build7(c,t1,t2,t3,t4,t5,t6,t7,t8) \ build7_stat (c,t1,t2,t3,t4,t5,t6,t7,t8 MEM_STAT_INFO) -extern tree build_gimple_modify_stmt_stat (tree, tree MEM_STAT_DECL); -#define build_gimple_modify_stmt(t1,t2) \ - build_gimple_modify_stmt_stat (t1,t2 MEM_STAT_INFO) - extern tree build_int_cst (tree, HOST_WIDE_INT); extern tree build_int_cst_type (tree, HOST_WIDE_INT); extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT); @@ -4746,15 +4674,19 @@ extern bool commutative_tree_code (enum tree_code); extern tree upper_bound_in_type (tree, tree); extern tree lower_bound_in_type (tree, tree); extern int operand_equal_for_phi_arg_p (const_tree, const_tree); -extern bool empty_body_p (tree); extern tree call_expr_arg (tree, int); extern tree *call_expr_argp (tree, int); extern tree call_expr_arglist (tree); +extern tree create_artificial_label (void); +extern const char *get_name (tree); extern bool stdarg_p (tree); extern bool prototype_p (tree); extern int function_args_count (tree); extern bool auto_var_in_fn_p (const_tree, const_tree); +/* In gimplify.c */ +extern tree unshare_expr (tree); + /* In stmt.c */ extern void expand_expr_stmt (tree); @@ -4808,10 +4740,11 @@ extern tree fold_ignored_result (tree); extern tree fold_abs_const (tree, tree); extern tree fold_indirect_ref_1 (tree, tree); extern void fold_defer_overflow_warnings (void); -extern void fold_undefer_overflow_warnings (bool, const_tree, int); +extern void fold_undefer_overflow_warnings (bool, const_gimple, int); extern void fold_undefer_and_ignore_overflow_warnings (void); extern bool fold_deferring_overflow_warnings_p (void); extern tree maybe_fold_offset_to_reference (tree, tree, tree); +extern tree maybe_fold_stmt_addition (tree, tree, tree); extern tree force_fit_type_double (tree, unsigned HOST_WIDE_INT, HOST_WIDE_INT, int, bool); @@ -4877,7 +4810,6 @@ extern tree constant_boolean_node (int, tree); extern tree build_low_bits_mask (tree, unsigned); extern bool tree_swap_operands_p (const_tree, const_tree, bool); -extern void swap_tree_operands (tree, tree *, tree *); extern enum tree_code swap_tree_comparison (enum tree_code); extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *); @@ -4894,8 +4826,7 @@ extern bool tree_binary_nonnegative_warnv_p (enum tree_code, tree, tree, tree, bool *); extern bool tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p); extern bool tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p); -extern bool tree_call_nonnegative_warnv_p (enum tree_code code, tree, tree, - tree, tree, bool *); +extern bool tree_call_nonnegative_warnv_p (tree, tree, tree, tree, bool *); extern bool tree_expr_nonzero_warnv_p (tree, bool *); @@ -4921,12 +4852,14 @@ extern tree build_call_expr (tree, int, ...); extern tree mathfn_built_in (tree, enum built_in_function fn); extern tree strip_float_extensions (tree); extern tree c_strlen (tree, int); -extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *); +extern tree std_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *); extern tree build_va_arg_indirect_ref (tree); extern tree build_string_literal (int, const char *); extern bool validate_arglist (const_tree, ...); extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode); extern int get_pointer_alignment (tree, unsigned int); +extern tree fold_call_stmt (gimple, bool); +extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function); /* In convert.c */ extern tree strip_float_extensions (tree); @@ -4943,6 +4876,8 @@ extern int tree_log2 (const_tree); extern int tree_floor_log2 (const_tree); extern int simple_cst_equal (const_tree, const_tree); extern hashval_t iterative_hash_expr (const_tree, hashval_t); +extern hashval_t iterative_hash_exprs_commutative (const_tree, + const_tree, hashval_t); extern hashval_t iterative_hash_hashval_t (hashval_t, hashval_t); extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT); extern int type_list_equal (const_tree, const_tree); @@ -4974,18 +4909,9 @@ extern tree build_addr (tree, tree); extern bool fields_compatible_p (const_tree, const_tree); extern tree find_compatible_field (tree, tree); -extern location_t expr_location (const_tree); -extern void set_expr_location (tree, location_t); -extern bool expr_has_location (const_tree); - -extern location_t *expr_locus (const_tree); extern void set_expr_locus (tree, source_location *); -extern const char *expr_filename (const_tree); -extern int expr_lineno (const_tree); extern tree *tree_block (tree); -extern tree *generic_tree_operand (tree, int); -extern tree *generic_tree_type (tree); extern location_t *block_nonartificial_location (tree); /* In function.c */ @@ -5006,7 +4932,7 @@ extern void preserve_temp_slots (rtx); extern int aggregate_value_p (const_tree, const_tree); extern void push_function_context (void); extern void pop_function_context (void); -extern tree gimplify_parameters (void); +extern gimple_seq gimplify_parameters (void); /* In print-rtl.c */ #ifdef BUFSIZ @@ -5064,6 +4990,7 @@ extern int flags_from_decl_or_type (const_tree); extern int call_expr_flags (const_tree); extern int setjmp_call_p (const_tree); +extern bool gimple_alloca_call_p (const_gimple); extern bool alloca_call_p (const_tree); extern bool must_pass_in_stack_var_size (enum machine_mode, const_tree); extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree); @@ -5122,12 +5049,6 @@ extern void expand_anon_union_decl (tree, tree, tree); extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *); #endif -/* In gimplify.c. */ -extern tree create_artificial_label (void); -extern void gimplify_function_tree (tree); -extern const char *get_name (const_tree); -extern tree unshare_expr (tree); -extern void sort_case_labels (tree); /* Interface of the DWARF2 unwind info support. */ @@ -5209,14 +5130,12 @@ typedef enum temp_list_kind, vec_kind, binfo_kind, - phi_kind, ssa_name_kind, constr_kind, x_kind, lang_decl, lang_type, omp_clause_kind, - gimple_stmt_kind, all_kinds } tree_node_kind; |