Convert compare_nonzero_chars to wide_ints.
gcc/ChangeLog: * tree-ssa-strlen.cc (compare_nonzero_chars): Convert to wide_ints.
This commit is contained in:
parent
637037f4e6
commit
fb5607ae6a
1 changed files with 4 additions and 4 deletions
|
@ -359,10 +359,10 @@ compare_nonzero_chars (strinfo *si, gimple *stmt,
|
|||
of the length range are equal return the result of the comparison
|
||||
same as in the constant case. Otherwise return a conservative
|
||||
result. */
|
||||
tree lower = wide_int_to_tree (vr.type (), vr.lower_bound ());
|
||||
tree upper = wide_int_to_tree (vr.type (), vr.upper_bound ());
|
||||
int cmpmin = compare_tree_int (lower, off);
|
||||
if (cmpmin > 0 || tree_int_cst_equal (lower, upper))
|
||||
signop sign = TYPE_SIGN (vr.type ());
|
||||
unsigned prec = TYPE_PRECISION (vr.type ());
|
||||
int cmpmin = wi::cmp (vr.lower_bound (), wi::uhwi (off, prec), sign);
|
||||
if (cmpmin > 0 || vr.singleton_p ())
|
||||
return cmpmin;
|
||||
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Reference in a new issue