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: wrong code generation #15175
Comments
Small comment:
this no longer works. In fact, at tip |
Also, disabling inlining fixes the issue: the code prints nothing. |
Happy accident. The fact that the code behaves differently with inlining disabled and enabled it's a clear bug in the code generated. Most likely it's a rule that folds the comparisons, but I'd have to minimize the code first to figure out which. Alternatively one can bisect and find which patch is the culprit. |
This is one is minimized:
|
Git bisect says it was introduced in https://go-review.googlesource.com/#/c/21256/ |
There are a few things wrong: This also happens: which is an instantiation of where c = 253 (coming from right shift) and d = -3 (coming from the constant above). |
In 21256 I changed the semantics of the AuxInt field to always be sign-extended. So -3 is right, 253 is wrong. It is ending up with 253 anyway because of a bad rewrite rule. CL pending. |
CL https://golang.org/cl/21586 mentions this issue. |
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +121c434 Thu Apr 7 09:57:06 2016 +0000 linux/amd64
go env
)?linux amd64
Compiled and ran the following code:
To print nothing
Clearly the comparison is wrong here.
The text was updated successfully, but these errors were encountered: