Commit 4e2d94a9 by Kazu Hirata Committed by Kazu Hirata

tree-vrp.c (extract_range_from_binary_expr): Clean up uses of vr0.type.

	* tree-vrp.c (extract_range_from_binary_expr): Clean up uses
	of vr0.type.

From-SVN: r108935
parent 8ccfa1cc
2005-12-22 Kazu Hirata <kazu@codesourcery.com>
* tree-vrp.c (extract_range_from_binary_expr): Clean up uses
of vr0.type.
2005-12-21 Joseph S. Myers <joseph@codesourcery.com> 2005-12-21 Joseph S. Myers <joseph@codesourcery.com>
PR middle-end/24998 PR middle-end/24998
......
...@@ -1167,6 +1167,7 @@ static void ...@@ -1167,6 +1167,7 @@ static void
extract_range_from_binary_expr (value_range_t *vr, tree expr) extract_range_from_binary_expr (value_range_t *vr, tree expr)
{ {
enum tree_code code = TREE_CODE (expr); enum tree_code code = TREE_CODE (expr);
enum value_range_type type;
tree op0, op1, min, max; tree op0, op1, min, max;
int cmp; int cmp;
value_range_t vr0 = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL }; 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) ...@@ -1220,6 +1221,9 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
return; 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 /* Refuse to operate on VARYING ranges, ranges of different kinds
and symbolic ranges. As an exception, we allow BIT_AND_EXPR 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 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) ...@@ -1425,7 +1429,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
&& tree_expr_nonnegative_p (vr1.max) && tree_expr_nonnegative_p (vr1.max)
&& TREE_CODE (vr1.max) == INTEGER_CST) && TREE_CODE (vr1.max) == INTEGER_CST)
{ {
vr0.type = VR_RANGE; type = VR_RANGE;
min = fold_convert (TREE_TYPE (expr), integer_zero_node); min = fold_convert (TREE_TYPE (expr), integer_zero_node);
max = vr1.max; max = vr1.max;
} }
...@@ -1455,7 +1459,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr) ...@@ -1455,7 +1459,7 @@ extract_range_from_binary_expr (value_range_t *vr, tree expr)
set_value_range_to_varying (vr); set_value_range_to_varying (vr);
} }
else else
set_value_range (vr, vr0.type, min, max, NULL); set_value_range (vr, type, min, max, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment