summaryrefslogtreecommitdiff
path: root/gcc/tree-vrp.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-22 01:16:57 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2005-12-22 01:16:57 +0000
commit0ed3ba34dfa4745d199647730f04c9b0d952ec92 (patch)
tree989e1293dd57648294bb4682a5040af44a4a3334 /gcc/tree-vrp.c
parent8297b093647832b8c829b9d34d04662befa34638 (diff)
downloadgcc-0ed3ba34dfa4745d199647730f04c9b0d952ec92.tar.gz
* tree-vrp.c (extract_range_from_binary_expr): Clean up uses
of vr0.type. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108935 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vrp.c')
-rw-r--r--gcc/tree-vrp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index a9609fa6157..b9503865fcf 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -1167,6 +1167,7 @@ static void
extract_range_from_binary_expr (value_range_t *vr, tree expr)
{
enum tree_code code = TREE_CODE (expr);
+ enum value_range_type type;
tree op0, op1, min, max;
int cmp;
value_range_t vr0 = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
@@ -1220,6 +1221,9 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
return;
}
+ /* The type of the resulting value range defaults to VR0.TYPE. */
+ type = vr0.type;
+
/* Refuse to operate on VARYING ranges, ranges of different kinds
and symbolic ranges. As an exception, we allow BIT_AND_EXPR
because we may be able to derive a useful range even if one of
@@ -1425,7 +1429,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
&& tree_expr_nonnegative_p (vr1.max)
&& TREE_CODE (vr1.max) == INTEGER_CST)
{
- vr0.type = VR_RANGE;
+ type = VR_RANGE;
min = fold_convert (TREE_TYPE (expr), integer_zero_node);
max = vr1.max;
}
@@ -1455,7 +1459,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
set_value_range_to_varying (vr);
}
else
- set_value_range (vr, vr0.type, min, max, NULL);
+ set_value_range (vr, type, min, max, NULL);
}