aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2006-01-18 12:47:16 -0700
committerJeff Law <law@gcc.gnu.org>2006-01-18 12:47:16 -0700
commitf9fe7aed71e486669af301c0beb0c58bc303ee39 (patch)
treed39d6d56ed7796b26c42b4c0d68518a4491b59a3 /gcc/tree-vrp.c
parent953ff28998b59b0912be907d74f7afa5a8ed1e9c (diff)
downloadgcc-f9fe7aed71e486669af301c0beb0c58bc303ee39.zip
gcc-f9fe7aed71e486669af301c0beb0c58bc303ee39.tar.gz
gcc-f9fe7aed71e486669af301c0beb0c58bc303ee39.tar.bz2
tree-vrp.c (test_for_singularity): Correct test for new min limit.
* tree-vrp.c (test_for_singularity): Correct test for new min limit. Use operand_equal_p rather than pointer equality for testing if new min/max values are equal. * tree-ssa-propagate.c (substitute_and_fold): Delay simplifications using range information until after propagation and folding. * gcc.c-torture/execute/930529-1.x: Use -fwrapv as test depends on wrapping on overflow semantics. * gcc.dg/tree-ssa/pr23109.c: Remove the .lim file too. * gcc.gc/tree-ssa/vrp23.c: New test. * gcc.gc/tree-ssa/vrp24.c: New test. From-SVN: r109904
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 7fcd62d..a5028b4 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1,5 +1,5 @@
/* Support routines for Value Range Propagation (VRP).
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>.
This file is part of GCC.
@@ -3970,7 +3970,7 @@ test_for_singularity (enum tree_code cond_code, tree op0,
if (cond_code == GT_EXPR)
{
tree one = build_int_cst (TREE_TYPE (op0), 1);
- max = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), max, one);
+ min = fold_build2 (PLUS_EXPR, TREE_TYPE (op0), min, one);
}
}
@@ -3987,10 +3987,10 @@ test_for_singularity (enum tree_code cond_code, tree op0,
else
max = vr->max;
- /* If the new min/max values have converged to a
- single value, then there is only one value which
- can satisfy the condition, return that value. */
- if (min == max && is_gimple_min_invariant (min))
+ /* If the new min/max values have converged to a single value,
+ then there is only one value which can satisfy the condition,
+ return that value. */
+ if (operand_equal_p (min, max, 0) && is_gimple_min_invariant (min))
return min;
}
return NULL;