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
cmd/compile: prove pass doesn't draw signed int conclusions from range checks #25115
Comments
@zdjones does your outstanding CL fix this issue as well? |
Punting to 1.14 in any case. |
Other prove changes since last year have updated this. It appears the signed limits are correct now. I think we can close this? After the I've included some extended debugging output below to show where this is from. The first column is the line number in math/expm1.go.
|
I suspect this is “fixed” because the walkinrange optimization is broken. #30645 |
Ha. I'll keep it on my radar until the walkinrange gets fixed, then I'll take another look. |
This might be fixed by outstanding prove CLs, but just in case, consider this snippet from math/expm1.go:
Note the switch case
k <= -2 || k > 56
. The compiler rewrites this into a single unsigned comparison:uint(x) > 57
. Seefunc walkinrange
in walk.go.After the
k < 20
check (in particular, when consideringuint64(k)<<52
, the prove pass has signed limits of [-9223372036854775808, 19] for k and no unsigned limits. But I believe that we should know that k is in [-2, 19].I might have the culprit/analysis wrong...but in any case, we should know more about
uint64(k)
here.Noticed while exploring #25087.
cc @rasky
The text was updated successfully, but these errors were encountered: