Commit b881887e by Richard Guenther Committed by Richard Biener

tree-vrp.c (extract_range_from_assert): CSE calls to compare_values where possible.

2007-01-07  Richard Guenther  <rguenther@suse.de>

	* tree-vrp.c (extract_range_from_assert): CSE calls to
	compare_values where possible.
	(extract_range_from_unary_expr): Likewise.

From-SVN: r120547
parent 696e990b
2007-01-07 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (extract_range_from_assert): CSE calls to
compare_values where possible.
(extract_range_from_unary_expr): Likewise.
2007-01-07 Anatoly Sokolov <aesok@post.ru> 2007-01-07 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr-protos.h (call_insn_operand): Delete prototype. * config/avr/avr-protos.h (call_insn_operand): Delete prototype.
......
...@@ -1066,6 +1066,7 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) ...@@ -1066,6 +1066,7 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
else else
{ {
tree min, max, anti_min, anti_max, real_min, real_max; tree min, max, anti_min, anti_max, real_min, real_max;
int cmp;
/* We want to compute the logical AND of the two ranges; /* We want to compute the logical AND of the two ranges;
there are three cases to consider. there are three cases to consider.
...@@ -1130,8 +1131,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) ...@@ -1130,8 +1131,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
/* Case 3a, the anti-range extends into the low /* Case 3a, the anti-range extends into the low
part of the real range. Thus creating a new part of the real range. Thus creating a new
low for the real range. */ low for the real range. */
else if ((compare_values (anti_max, real_min) == 1 else if (((cmp = compare_values (anti_max, real_min)) == 1
|| compare_values (anti_max, real_min) == 0) || cmp == 0)
&& compare_values (anti_max, real_max) == -1) && compare_values (anti_max, real_max) == -1)
{ {
min = fold_build2 (PLUS_EXPR, TREE_TYPE (var_vr->min), min = fold_build2 (PLUS_EXPR, TREE_TYPE (var_vr->min),
...@@ -1144,8 +1145,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) ...@@ -1144,8 +1145,8 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
part of the real range. Thus creating a new part of the real range. Thus creating a new
higher for the real range. */ higher for the real range. */
else if (compare_values (anti_min, real_min) == 1 else if (compare_values (anti_min, real_min) == 1
&& (compare_values (anti_min, real_max) == -1 && ((cmp = compare_values (anti_min, real_max)) == -1
|| compare_values (anti_min, real_max) == 0)) || cmp == 0))
{ {
max = fold_build2 (MINUS_EXPR, TREE_TYPE (var_vr->min), max = fold_build2 (MINUS_EXPR, TREE_TYPE (var_vr->min),
anti_min, anti_min,
...@@ -1734,8 +1735,8 @@ extract_range_from_unary_expr (value_range_t *vr, tree expr) ...@@ -1734,8 +1735,8 @@ extract_range_from_unary_expr (value_range_t *vr, tree expr)
&& is_gimple_val (new_max) && is_gimple_val (new_max)
&& tree_int_cst_equal (new_min, orig_min) && tree_int_cst_equal (new_min, orig_min)
&& tree_int_cst_equal (new_max, orig_max) && tree_int_cst_equal (new_max, orig_max)
&& compare_values (new_min, new_max) <= 0 && (cmp = compare_values (new_min, new_max)) <= 0
&& compare_values (new_min, new_max) >= -1) && cmp >= -1)
{ {
set_value_range (vr, VR_RANGE, new_min, new_max, vr->equiv); set_value_range (vr, VR_RANGE, new_min, new_max, vr->equiv);
return; return;
......
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