aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2005-12-21 16:48:59 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2005-12-21 16:48:59 +0000
commit0dd4b47b7fc8c9f9296429d348ec64df5afeb35a (patch)
tree0990c6705e08d5b4c38ec5a270b8925019dc291c /gcc
parentad44e786b879ce503b59b9e3afd5abb821133f88 (diff)
downloadgcc-0dd4b47b7fc8c9f9296429d348ec64df5afeb35a.zip
gcc-0dd4b47b7fc8c9f9296429d348ec64df5afeb35a.tar.gz
gcc-0dd4b47b7fc8c9f9296429d348ec64df5afeb35a.tar.bz2
tree-data-ref.c (estimate_niter_from_size_of_data): Replace fold_build2 with fold_binary.
* tree-data-ref.c (estimate_niter_from_size_of_data): Replace fold_build2 with fold_binary. * tree-ssa-ccp.c (visit_assignment, maybe_fold_stmt_addition): Replace fold_build1 with fold_unary. * tree-ssa-reassoc.c (optimize_ops_list): Replace fold_build2 with fold_binary. From-SVN: r108913
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/tree-data-ref.c2
-rw-r--r--gcc/tree-ssa-ccp.c10
-rw-r--r--gcc/tree-ssa-reassoc.c4
4 files changed, 17 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e00ed90..69ca302 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2005-12-21 Kazu Hirata <kazu@codesourcery.com>
+
+ * tree-data-ref.c (estimate_niter_from_size_of_data): Replace
+ fold_build2 with fold_binary.
+ * tree-ssa-ccp.c (visit_assignment, maybe_fold_stmt_addition):
+ Replace fold_build1 with fold_unary.
+ * tree-ssa-reassoc.c (optimize_ops_list): Replace fold_build2
+ with fold_binary.
+
2005-12-21 Steven Bosscher <stevenb@suse.de>
PR rtl-optimization/25196
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 10a223e..d1f2bf5 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -786,7 +786,7 @@ estimate_niter_from_size_of_data (struct loop *loop,
&& TREE_CODE (step) == INTEGER_CST)
{
tree i_plus_s = fold_build2 (PLUS_EXPR, integer_type_node, init, step);
- tree sign = fold_build2 (GT_EXPR, boolean_type_node, i_plus_s, init);
+ tree sign = fold_binary (GT_EXPR, boolean_type_node, i_plus_s, init);
if (sign == boolean_true_node)
estimation = fold_build2 (CEIL_DIV_EXPR, integer_type_node,
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index c428ef0..6731045 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -1191,9 +1191,9 @@ visit_assignment (tree stmt, tree *output_p)
if (TREE_CODE (orig_lhs) == VIEW_CONVERT_EXPR
&& val.lattice_val == CONSTANT)
{
- tree w = fold_build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (TREE_OPERAND (orig_lhs, 0)),
- val.value);
+ tree w = fold_unary (VIEW_CONVERT_EXPR,
+ TREE_TYPE (TREE_OPERAND (orig_lhs, 0)),
+ val.value);
orig_lhs = TREE_OPERAND (orig_lhs, 0);
if (w && is_gimple_min_invariant (w))
@@ -1901,9 +1901,9 @@ maybe_fold_stmt_addition (tree expr)
{
if (TYPE_UNSIGNED (TREE_TYPE (op1)))
return NULL;
- op1 = fold_build1 (NEGATE_EXPR, TREE_TYPE (op1), op1);
+ op1 = fold_unary (NEGATE_EXPR, TREE_TYPE (op1), op1);
/* ??? In theory fold should always produce another integer. */
- if (TREE_CODE (op1) != INTEGER_CST)
+ if (op1 == NULL || TREE_CODE (op1) != INTEGER_CST)
return NULL;
}
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 97492b8..879e570 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -755,10 +755,10 @@ optimize_ops_list (enum tree_code opcode,
&& lang_hooks.types_compatible_p (TREE_TYPE (oelm1->op),
TREE_TYPE (oelast->op)))
{
- tree folded = fold_build2 (opcode, TREE_TYPE (oelm1->op),
+ tree folded = fold_binary (opcode, TREE_TYPE (oelm1->op),
oelm1->op, oelast->op);
- if (is_gimple_min_invariant (folded))
+ if (folded && is_gimple_min_invariant (folded))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Merging constants\n");