diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2005-04-23 02:01:53 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2005-04-23 02:01:53 +0000 |
commit | 721425b6ada0661975ba11b6b4dfc83421150886 (patch) | |
tree | 4d5c798a9511b850de0000a74818df18ef340983 /gcc/tree-vrp.c | |
parent | 84d658141e6b1d315b0eba5f19a3c57a7c51fd3f (diff) | |
download | gcc-721425b6ada0661975ba11b6b4dfc83421150886.zip gcc-721425b6ada0661975ba11b6b4dfc83421150886.tar.gz gcc-721425b6ada0661975ba11b6b4dfc83421150886.tar.bz2 |
re PR tree-optimization/21088 (VRP passes fold the type of operands of a comparison)
PR tree-optimization/21088
* fold-const.c (fold_unary, fold_binary, fold_ternary):
Export.
* tree-vrp.c (compare_values): Use fold_binary to compare
pointers. Use boolean_type_node as the type of a comparison
expression being folded.
* tree.h: Add prototypes for fold_unary, fold_binary,
fold_ternary.
From-SVN: r98600
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r-- | gcc/tree-vrp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index bb68df6..4a0859e 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -416,17 +416,17 @@ compare_values (tree val1, tree val2) return 0; /* If VAL1 is a lower address than VAL2, return -1. */ - t = fold (build2 (LT_EXPR, TREE_TYPE (val1), val1, val2)); + t = fold_binary (LT_EXPR, boolean_type_node, val1, val2); if (t == boolean_true_node) return -1; /* If VAL1 is a higher address than VAL2, return +1. */ - t = fold (build2 (GT_EXPR, TREE_TYPE (val1), val1, val2)); + t = fold_binary (GT_EXPR, boolean_type_node, val1, val2); if (t == boolean_true_node) return 1; /* If VAL1 is different than VAL2, return +2. */ - t = fold (build2 (NE_EXPR, TREE_TYPE (val1), val1, val2)); + t = fold_binary (NE_EXPR, boolean_type_node, val1, val2); if (t == boolean_true_node) return 2; |