aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog21
-rw-r--r--gcc/builtins.c2
-rw-r--r--gcc/c-parser.c5
-rw-r--r--gcc/c-typeck.c8
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/expmed.c12
-rw-r--r--gcc/tree-eh.c2
-rw-r--r--gcc/tree-mudflap.c4
-rw-r--r--gcc/tree-ssa-alias.c2
-rw-r--r--gcc/tree-ssa-loop-ivopts.c6
-rw-r--r--gcc/tree-ssa-loop-prefetch.c2
-rw-r--r--gcc/tree-ssa-sccvn.c2
-rw-r--r--gcc/tree-vect-loop.c2
-rw-r--r--gcc/tree.c7
-rw-r--r--gcc/tree.h2
-rw-r--r--gcc/varasm.c2
18 files changed, 57 insertions, 34 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8105229..1ef39ed 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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):
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 2bcf656..40327e0e 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -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);
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index e773fe0..306d46b 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -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:
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index edf0d8b..bcbc296 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -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,
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8b1399c..e03ca75 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 70915cb..d5b0161 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0a9f255..5d07956 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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;
diff --git a/gcc/expmed.c b/gcc/expmed.c
index e6b30e4..ddace9f 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -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);
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 1fb531f..ab501d5 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -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;
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index b5a3e43..99c5bce 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -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);
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index d73ff59..a95d78c 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -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
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 83ec13e..5f2c6ae 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -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;
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 008f2ce..a5b5112 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -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++)
{
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 9ce37f7..8eafd9b 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -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. */
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
index ecfc670..49a8721 100644
--- a/gcc/tree-vect-loop.c
+++ b/gcc/tree-vect-loop.c
@@ -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);
diff --git a/gcc/tree.c b/gcc/tree.c
index 7f37d45..5726ca4 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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);
diff --git a/gcc/tree.h b/gcc/tree.h
index 326950c..3c0806e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -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]
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 00b4af9..9a4c193 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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))));