Commit 7343ff45 by Ian Lance Taylor Committed by Ian Lance Taylor

re PR tree-optimization/31034 (ICE in set_value_range, at tree-vrp.c:267)

	PR tree-optimization/31034
	* tree-vrp.c (extract_range_from_assert): Don't try to handle a
	half-range if the other side is an overflow infinity.

From-SVN: r122562
parent 666ff4f6
2007-03-05 Ian Lance Taylor <iant@google.com>
PR tree-optimization/31034
* tree-vrp.c (extract_range_from_assert): Don't try to handle a
half-range if the other side is an overflow infinity.
2007-03-05 Bernd Schmidt <bernd.schmidt@analog.com> 2007-03-05 Bernd Schmidt <bernd.schmidt@analog.com>
* config.gcc (bfin*-uclinux*): Use t-bfin-uclinux. * config.gcc (bfin*-uclinux*): Use t-bfin-uclinux.
......
...@@ -1137,13 +1137,14 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) ...@@ -1137,13 +1137,14 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
/* If the maximum value forces us to be out of bounds, simply punt. /* If the maximum value forces us to be out of bounds, simply punt.
It would be pointless to try and do anything more since this It would be pointless to try and do anything more since this
all should be optimized away above us. */ all should be optimized away above us. */
if (cond_code == LT_EXPR && compare_values (max, min) == 0) if ((cond_code == LT_EXPR
&& compare_values (max, min) == 0)
|| is_overflow_infinity (max))
set_value_range_to_varying (vr_p); set_value_range_to_varying (vr_p);
else else
{ {
/* For LT_EXPR, we create the range [MIN, MAX - 1]. */ /* For LT_EXPR, we create the range [MIN, MAX - 1]. */
if (cond_code == LT_EXPR if (cond_code == LT_EXPR)
&& !is_positive_overflow_infinity (max))
{ {
tree one = build_int_cst (type, 1); tree one = build_int_cst (type, 1);
max = fold_build2 (MINUS_EXPR, type, max, one); max = fold_build2 (MINUS_EXPR, type, max, one);
...@@ -1169,13 +1170,14 @@ extract_range_from_assert (value_range_t *vr_p, tree expr) ...@@ -1169,13 +1170,14 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
/* If the minimum value forces us to be out of bounds, simply punt. /* If the minimum value forces us to be out of bounds, simply punt.
It would be pointless to try and do anything more since this It would be pointless to try and do anything more since this
all should be optimized away above us. */ all should be optimized away above us. */
if (cond_code == GT_EXPR && compare_values (min, max) == 0) if ((cond_code == GT_EXPR
&& compare_values (min, max) == 0)
|| is_overflow_infinity (min))
set_value_range_to_varying (vr_p); set_value_range_to_varying (vr_p);
else else
{ {
/* For GT_EXPR, we create the range [MIN + 1, MAX]. */ /* For GT_EXPR, we create the range [MIN + 1, MAX]. */
if (cond_code == GT_EXPR if (cond_code == GT_EXPR)
&& !is_negative_overflow_infinity (min))
{ {
tree one = build_int_cst (type, 1); tree one = build_int_cst (type, 1);
min = fold_build2 (PLUS_EXPR, type, min, one); min = fold_build2 (PLUS_EXPR, type, min, one);
......
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