-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ConstantRange::multiply isn't always conservative #4917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I added a fast fix in r75444 which should prevent the below cases, but won't provide minimal answers in a whole ton of cases that it ought to. Multiply needs to be rethought... |
unionWith has some problems; they all take the form that the upper limit is a feasible value:ERROR: Found invalid values!
|
Nevermind, they don't all take that form, I looked too quickly. |
intersectWith has problems, we should probably remove it and use maximalIntersectWith. Test cases:ERROR: Found invalid values!
|
Here is a signExtend failure:ERROR: Found invalid values!
|
And two sgt errors:ERROR: Found invalid values!
|
This has been fixed somewhere along the way. |
Extended Description
ConstantRange::multiply sometimes computes a set which does not include some possible values.
Here are some klee generated test cases:
ERROR: Found invalid values!
A = 1 is in LHS = [1, 0), and
B = 0 is in RHS = [0, 2), but
A mul B = 0 is not in (LHS mul RHS) = [0, 0)
ERROR: Found invalid values!
A = 1 is in LHS = [0, 2), and
B = 1 is in RHS = [1, 0), but
A mul B = 1 is not in (LHS mul RHS) = [0, 0)
ERROR: Found invalid values!
A = 2 is in LHS = [1, 6), and
B = 7 is in RHS = [6, 2), but
A mul B = 14 is not in (LHS mul RHS) = [6, 6)
ERROR: Found invalid values!
A = 1 is in LHS = [1, 6), and
B = 7 is in RHS = [6, 2), but
A mul B = 7 is not in (LHS mul RHS) = [6, 6)
ERROR: Found invalid values!
A = 10 is in LHS = [6, 14), and
B = 11 is in RHS = [11, 6), but
A mul B = 14 is not in (LHS mul RHS) = [2, 2)
ERROR: Found invalid values!
A = 2 is in LHS = [2, 8), and
B = 4 is in RHS = [4, 2), but
A mul B = 8 is not in (LHS mul RHS) = [8, 8)
ERROR: Found invalid values!
A = 3 is in LHS = [1, 0), and
B = 3 is in RHS = [2, 0), but
A mul B = 9 is not in (LHS mul RHS) = [2, 2)
The text was updated successfully, but these errors were encountered: