Commit 04dce5a4 by Zdenek Dvorak Committed by Zdenek Dvorak

tree-vrp.c (valid_value_p): New function.

	* tree-vrp.c (valid_value_p): New function.
	(adjust_range_with_scev): Fail if the value of bound is not
	simple.

From-SVN: r113907
parent fa807ff6
2006-05-19 Zdenek Dvorak <dvorakz@suse.cz>
* tree-vrp.c (valid_value_p): New function.
(adjust_range_with_scev): Fail if the value of bound is not
simple.
2006-05-19 Richard Sandiford <richard@codesourcery.com>
* config/mips/linux-unwind.h: Include <asm/unistd.h>
......
......@@ -409,6 +409,22 @@ vrp_expr_computes_nonzero (tree expr)
return false;
}
/* Returns true if EXPR is a valid value (as expected by compare_values) --
a gimple invariant, or SSA_NAME +- CST. */
static bool
valid_value_p (tree expr)
{
if (TREE_CODE (expr) == SSA_NAME)
return true;
if (TREE_CODE (expr) == PLUS_EXPR
|| TREE_CODE (expr) == MINUS_EXPR)
return (TREE_CODE (TREE_OPERAND (expr, 0)) == SSA_NAME
&& TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST);
return is_gimple_min_invariant (expr);
}
/* Compare two values VAL1 and VAL2. Return
......@@ -1974,9 +1990,12 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop, tree stmt,
step = evolution_part_in_loop_num (chrec, loop->num);
/* If STEP is symbolic, we can't know whether INIT will be the
minimum or maximum value in the range. */
minimum or maximum value in the range. Also, unless INIT is
a simple expression, compare_values and possibly other functions
in tree-vrp won't be able to handle it. */
if (step == NULL_TREE
|| !is_gimple_min_invariant (step))
|| !is_gimple_min_invariant (step)
|| !valid_value_p (init))
return;
/* Do not adjust ranges when chrec may wrap. */
......
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