@@ -144,18 +144,18 @@ split_at_bb_p (class loop *loop, basic_block bb, tree *border, affine_iv *iv,
value range. */
else
{
- int_range<2> r;
+ Value_Range r (TREE_TYPE (op0));
get_global_range_query ()->range_of_expr (r, op0, stmt);
if (!r.varying_p () && !r.undefined_p ()
&& TREE_CODE (op1) == INTEGER_CST)
{
wide_int val = wi::to_wide (op1);
- if (known_eq (val, r.lower_bound ()))
+ if (known_eq (val, wi::to_wide (r.lbound ())))
{
code = (code == EQ_EXPR) ? LE_EXPR : GT_EXPR;
break;
}
- else if (known_eq (val, r.upper_bound ()))
+ else if (known_eq (val, wi::to_wide (r.ubound ())))
{
code = (code == EQ_EXPR) ? GE_EXPR : LT_EXPR;
break;
@@ -215,7 +215,7 @@ get_range (tree val, gimple *stmt, wide_int minmax[2],
rvals = get_range_query (cfun);
}
- value_range vr;
+ Value_Range vr (TREE_TYPE (val));
if (!rvals->range_of_expr (vr, val, stmt))
return NULL_TREE;
@@ -156,11 +156,9 @@ range_query::get_tree_range (vrange &r, tree expr, gimple *stmt)
{
case INTEGER_CST:
{
- irange &i = as_a <irange> (r);
if (TREE_OVERFLOW_P (expr))
expr = drop_tree_overflow (expr);
- wide_int w = wi::to_wide (expr);
- i.set (TREE_TYPE (expr), w, w);
+ r.set (expr, expr);
return true;
}
@@ -310,7 +310,8 @@ tree
simplify_using_ranges::fold_cond_with_ops (enum tree_code code,
tree op0, tree op1, gimple *s)
{
- int_range_max r0, r1;
+ Value_Range r0 (TREE_TYPE (op0));
+ Value_Range r1 (TREE_TYPE (op1));
if (!query->range_of_expr (r0, op0, s)
|| !query->range_of_expr (r1, op1, s))
return NULL_TREE;