This method should have been private, and somehow seeped into the API.
Tested and benchmarked on x86-64 Linux.
gcc/ChangeLog:
* gimple-range-cache.h (non_null_ref::adjust_range): Do not use
irange::intersect (wide_int, wide_int).
* gimple-range-fold.cc (adjust_pointer_diff_expr): Same.
(adjust_imagpart_expr): Same.
* value-range.h (irange::intersect (wide_int, wide_int)): Make
private.
if (non_null_deref_p (name, bb, search_dom))
{
// Remove zero from the range.
- unsigned prec = TYPE_PRECISION (TREE_TYPE (name));
- r.intersect (wi::one (prec), wi::max_value (prec, UNSIGNED));
+ gcc_checking_assert (TYPE_UNSIGNED (TREE_TYPE (name)));
+ int_range<2> nz;
+ nz.set_nonzero (TREE_TYPE (name));
+ r.intersect (nz);
return true;
}
return false;
tree max = vrp_val_max (ptrdiff_type_node);
unsigned prec = TYPE_PRECISION (TREE_TYPE (max));
wide_int wmaxm1 = wi::to_wide (max, prec) - 1;
- res.intersect (wi::zero (prec), wmaxm1);
+ res.intersect (int_range<2> (TREE_TYPE (max), wi::zero (prec), wmaxm1));
}
}
tree cst = gimple_assign_rhs1 (def_stmt);
if (TREE_CODE (cst) == COMPLEX_CST)
{
- wide_int imag = wi::to_wide (TREE_IMAGPART (cst));
- res.intersect (imag, imag);
+ int_range<2> imag (TREE_IMAGPART (cst), TREE_IMAGPART (cst));
+ res.intersect (imag);
}
}
}
// In-place operators.
void union_ (const irange &);
void intersect (const irange &);
- void intersect (const wide_int& lb, const wide_int& ub);
void invert ();
// Operator overloads.
void irange_set_1bit_anti_range (tree, tree);
bool varying_compatible_p () const;
+ void intersect (const wide_int& lb, const wide_int& ub);
unsigned char m_num_ranges;
unsigned char m_max_ranges;
ENUM_BITFIELD(value_range_kind) m_kind : 8;