tree.h (enum tree_index): Add TI_INTEGER_THREE.

* tree.h (enum tree_index): Add TI_INTEGER_THREE.
	(integer_three_node): Add.
	* tree.c (build_common_tree_nodes_2): Use integer_type_node insead of
	NULL_TREE in build_int_cst calls. Initialize the integer_three_node.
	* builtins.c (expand_builtin_prefetch): Use common tree nodes instead
	of call build_int_cst.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Ditto.
	* tree-ssa-loop-ivopts.c (idx_find_step): Ditto.
	(find_interesting_uses_address): Ditto.
	* tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Ditto.
	* tree-eh.c (lower_eh_constructs_2): Ditto.
	* tree-vect-loop.c (get_initial_def_for_induction): Ditto.
	* c-typeck.c (really_start_incremental_init, push_init_level): Ditto.
	* expmed.c (expand_divmod): Ditto.
	* tree-mudflap.c (mx_register_decls): Ditto.
	* varasm.c (array_size_for_constructor): Ditto.
	* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Ditto.
	* c-parser.c (c_parser_postfix_expression): Ditto.
	
/cp
	* decl.c (integer_three_node): Remove.
	(cxx_init_decl_processing): Do not initialize the integer_three_node.
	* cp-tree.h (integer_three_node): Remove.

From-SVN: r162230
This commit is contained in:
Anatoly Sokolov 2010-07-15 22:47:23 +04:00 committed by Anatoly Sokolov
parent 67bb020619
commit 9a9d280e02
18 changed files with 57 additions and 34 deletions

View File

@ -1,3 +1,24 @@
2010-07-15 Anatoly Sokolov <aesok@post.ru>
* tree.h (enum tree_index): Add TI_INTEGER_THREE.
(integer_three_node): Add.
* tree.c (build_common_tree_nodes_2): Use integer_type_node insead of
NULL_TREE in build_int_cst calls. Initialize the integer_three_node.
* builtins.c (expand_builtin_prefetch): Use common tree nodes instead
of call build_int_cst.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Ditto.
* tree-ssa-loop-ivopts.c (idx_find_step): Ditto.
(find_interesting_uses_address): Ditto.
* tree-ssa-alias.c (ao_ref_init_from_ptr_and_size): Ditto.
* tree-eh.c (lower_eh_constructs_2): Ditto.
* tree-vect-loop.c (get_initial_def_for_induction): Ditto.
* c-typeck.c (really_start_incremental_init, push_init_level): Ditto.
* expmed.c (expand_divmod): Ditto.
* tree-mudflap.c (mx_register_decls): Ditto.
* varasm.c (array_size_for_constructor): Ditto.
* tree-ssa-loop-prefetch.c (issue_prefetch_ref): Ditto.
* c-parser.c (c_parser_postfix_expression): Ditto.
2010-07-15 Bernd Schmidt <bernds@codesourcery.com>
* postreload.c (last_label_ruid, first_index_reg, last_index_reg):

View File

@ -1062,7 +1062,7 @@ expand_builtin_prefetch (tree exp)
if (nargs > 2)
arg2 = CALL_EXPR_ARG (exp, 2);
else
arg2 = build_int_cst (NULL_TREE, 3);
arg2 = integer_three_node;
/* Argument 0 is an address. */
op0 = expand_expr (arg0, NULL_RTX, Pmode, EXPAND_NORMAL);

View File

@ -5847,9 +5847,8 @@ c_parser_postfix_expression (c_parser *parser)
e1 = TYPE_MAIN_VARIANT (groktypename (t1, NULL, NULL));
e2 = TYPE_MAIN_VARIANT (groktypename (t2, NULL, NULL));
expr.value = comptypes (e1, e2)
? build_int_cst (NULL_TREE, 1)
: build_int_cst (NULL_TREE, 0);
expr.value
= comptypes (e1, e2) ? integer_one_node : integer_zero_node;
}
break;
case RID_AT_SELECTOR:

View File

@ -6498,14 +6498,14 @@ really_start_incremental_init (tree type)
/* Detect non-empty initializations of zero-length arrays. */
if (constructor_max_index == NULL_TREE
&& TYPE_SIZE (constructor_type))
constructor_max_index = build_int_cst (NULL_TREE, -1);
constructor_max_index = integer_minus_one_node;
/* constructor_max_index needs to be an INTEGER_CST. Attempts
to initialize VLAs will cause a proper error; avoid tree
checking errors as well by setting a safe value. */
if (constructor_max_index
&& TREE_CODE (constructor_max_index) != INTEGER_CST)
constructor_max_index = build_int_cst (NULL_TREE, -1);
constructor_max_index = integer_minus_one_node;
constructor_index
= convert (bitsizetype,
@ -6706,14 +6706,14 @@ push_init_level (int implicit, struct obstack * braced_init_obstack)
/* Detect non-empty initializations of zero-length arrays. */
if (constructor_max_index == NULL_TREE
&& TYPE_SIZE (constructor_type))
constructor_max_index = build_int_cst (NULL_TREE, -1);
constructor_max_index = integer_minus_one_node;
/* constructor_max_index needs to be an INTEGER_CST. Attempts
to initialize VLAs will cause a proper error; avoid tree
checking errors as well by setting a safe value. */
if (constructor_max_index
&& TREE_CODE (constructor_max_index) != INTEGER_CST)
constructor_max_index = build_int_cst (NULL_TREE, -1);
constructor_max_index = integer_minus_one_node;
constructor_index
= convert (bitsizetype,

View File

@ -1,3 +1,9 @@
2010-07-15 Anatoly Sokolov <aesok@post.ru>
* decl.c (integer_three_node): Remove.
(cxx_init_decl_processing): Do not initialize the integer_three_node.
* cp-tree.h (integer_three_node): Remove.
2010-07-15 Nathan Froyd <froydnj@codesourcery.com>
* cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN.

View File

@ -4006,7 +4006,6 @@ typedef enum base_kind {
/* For building calls to `delete'. */
extern GTY(()) tree integer_two_node;
extern GTY(()) tree integer_three_node;
/* The number of function bodies which we are currently processing.
(Zero if we are at namespace scope, one inside the body of a

View File

@ -169,9 +169,9 @@ tree static_aggregates;
/* -- end of C++ */
/* A node for the integer constants 2, and 3. */
/* A node for the integer constant 2. */
tree integer_two_node, integer_three_node;
tree integer_two_node;
/* Used only for jumps to as-yet undefined labels, since jumps to
defined labels can have their validity checked immediately. */
@ -3439,7 +3439,6 @@ cxx_init_decl_processing (void)
java_boolean_type_node = record_builtin_java_type ("__java_boolean", -1);
integer_two_node = build_int_cst (NULL_TREE, 2);
integer_three_node = build_int_cst (NULL_TREE, 3);
record_builtin_type (RID_BOOL, "bool", boolean_type_node);
truthvalue_type_node = boolean_type_node;

View File

@ -4064,10 +4064,8 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
t2 = force_operand (gen_rtx_MINUS (compute_mode,
op0, t1),
NULL_RTX);
t3 = expand_shift
(RSHIFT_EXPR, compute_mode, t2,
build_int_cst (NULL_TREE, 1),
NULL_RTX,1);
t3 = expand_shift (RSHIFT_EXPR, compute_mode, t2,
integer_one_node, NULL_RTX, 1);
t4 = force_operand (gen_rtx_PLUS (compute_mode,
t1, t3),
NULL_RTX);
@ -4751,8 +4749,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
}
tem = plus_constant (op1, -1);
tem = expand_shift (RSHIFT_EXPR, compute_mode, tem,
build_int_cst (NULL_TREE, 1),
NULL_RTX, 1);
integer_one_node, NULL_RTX, 1);
do_cmp_and_jump (remainder, tem, LEU, compute_mode, label);
expand_inc (quotient, const1_rtx);
expand_dec (remainder, op1);
@ -4777,8 +4774,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode,
abs_rem = expand_abs (compute_mode, remainder, NULL_RTX, 1, 0);
abs_op1 = expand_abs (compute_mode, op1, NULL_RTX, 1, 0);
tem = expand_shift (LSHIFT_EXPR, compute_mode, abs_rem,
build_int_cst (NULL_TREE, 1),
NULL_RTX, 1);
integer_one_node, NULL_RTX, 1);
do_cmp_and_jump (tem, abs_op1, LTU, compute_mode, label);
tem = expand_binop (compute_mode, xor_optab, op0, op1,
NULL_RTX, 0, OPTAB_WIDEN);

View File

@ -1877,7 +1877,7 @@ lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
else
{
/* The user has dome something silly. Remove it. */
rhs = build_int_cst (ptr_type_node, 0);
rhs = null_pointer_node;
goto do_replace;
}
break;

View File

@ -1074,7 +1074,7 @@ mx_register_decls (tree decl, gimple_seq seq, location_t location)
unregister_fncall = gimple_build_call (mf_unregister_fndecl, 3,
unregister_fncall_param,
size,
build_int_cst (NULL_TREE, 3));
integer_three_node);
variable_name = mf_varname_tree (decl);
@ -1087,7 +1087,7 @@ mx_register_decls (tree decl, gimple_seq seq, location_t location)
register_fncall = gimple_build_call (mf_register_fndecl, 4,
register_fncall_param,
size,
build_int_cst (NULL_TREE, 3),
integer_three_node,
variable_name);

View File

@ -517,7 +517,7 @@ ao_ref_init_from_ptr_and_size (ao_ref *ref, tree ptr, tree size)
else
{
ref->base = build2 (MEM_REF, char_type_node,
ptr, build_int_cst (ptr_type_node, 0));
ptr, null_pointer_node);
ref->offset = 0;
}
if (size

View File

@ -1418,7 +1418,7 @@ idx_find_step (tree base, tree *idx, void *data)
}
else
/* The step for pointer arithmetics already is 1 byte. */
step = build_int_cst (sizetype, 1);
step = size_one_node;
iv_base = iv->base;
iv_step = iv->step;
@ -1611,7 +1611,7 @@ may_be_nonaddressable_p (tree expr)
static void
find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p)
{
tree base = *op_p, step = build_int_cst (sizetype, 0);
tree base = *op_p, step = size_zero_node;
struct iv *civ;
struct ifs_ivopts_data ifs_ivopts_data;
@ -1669,7 +1669,7 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p
{
ifs_ivopts_data.ivopts_data = data;
ifs_ivopts_data.stmt = stmt;
ifs_ivopts_data.step = build_int_cst (sizetype, 0);
ifs_ivopts_data.step = size_zero_node;
if (!for_each_index (&base, idx_find_step, &ifs_ivopts_data)
|| integer_zerop (ifs_ivopts_data.step))
goto fail;

View File

@ -1083,7 +1083,7 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
addr_base = force_gimple_operand_gsi (&bsi, unshare_expr (addr_base),
true, NULL, true, GSI_SAME_STMT);
write_p = ref->write_p ? integer_one_node : integer_zero_node;
local = build_int_cst (integer_type_node, nontemporal ? 0 : 3);
local = nontemporal ? integer_zero_node : integer_three_node;
for (ap = 0; ap < n_prefetches; ap++)
{

View File

@ -564,7 +564,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
base = TMR_SYMBOL (ref) ? TMR_SYMBOL (ref) : TMR_BASE (ref);
if (!base)
base = build_int_cst (ptr_type_node, 0);
base = null_pointer_node;
memset (&temp, 0, sizeof (temp));
/* We do not care for spurious type qualifications. */

View File

@ -2608,7 +2608,7 @@ get_initial_def_for_induction (gimple iv_phi)
if (INTEGRAL_TYPE_P (scalar_type))
step_expr = build_int_cst (scalar_type, 0);
else if (POINTER_TYPE_P (scalar_type))
step_expr = build_int_cst (sizetype, 0);
step_expr = size_zero_node;
else
step_expr = build_real (scalar_type, dconst0);

View File

@ -8969,9 +8969,10 @@ void
build_common_tree_nodes_2 (int short_double)
{
/* Define these next since types below may used them. */
integer_zero_node = build_int_cst (NULL_TREE, 0);
integer_one_node = build_int_cst (NULL_TREE, 1);
integer_minus_one_node = build_int_cst (NULL_TREE, -1);
integer_zero_node = build_int_cst (integer_type_node, 0);
integer_one_node = build_int_cst (integer_type_node, 1);
integer_three_node = build_int_cst (integer_type_node, 3);
integer_minus_one_node = build_int_cst (integer_type_node, -1);
size_zero_node = size_int (0);
size_one_node = size_int (1);

View File

@ -3515,6 +3515,7 @@ enum tree_index
TI_INTEGER_ZERO,
TI_INTEGER_ONE,
TI_INTEGER_THREE,
TI_INTEGER_MINUS_ONE,
TI_NULL_POINTER,
@ -3669,6 +3670,7 @@ extern GTY(()) tree global_trees[TI_MAX];
#define integer_zero_node global_trees[TI_INTEGER_ZERO]
#define integer_one_node global_trees[TI_INTEGER_ONE]
#define integer_three_node global_trees[TI_INTEGER_THREE]
#define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
#define size_zero_node global_trees[TI_SIZE_ZERO]
#define size_one_node global_trees[TI_SIZE_ONE]

View File

@ -4908,7 +4908,7 @@ array_size_for_constructor (tree val)
tmp = TYPE_MIN_VALUE (TYPE_DOMAIN (TREE_TYPE (val)));
i = size_binop (MINUS_EXPR, fold_convert (sizetype, max_index),
fold_convert (sizetype, tmp));
i = size_binop (PLUS_EXPR, i, build_int_cst (sizetype, 1));
i = size_binop (PLUS_EXPR, i, size_one_node);
/* Multiply by the array element unit size to find number of bytes. */
i = size_binop (MULT_EXPR, i, TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (val))));