-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: wrong shift code generation #12133
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
A simpler testcase: package main
import "fmt"
func main() {
fmt.Println(f1())
}
func f1() uint {
v1 := uint(48)
return v1 >> ((1 >> v1) + (1 >> v1))
} Should print 48, but the last version returns 0. |
CC @rsc |
Bisect says this is the culprit: https://go-review.googlesource.com/#/c/7853/ Author: Russ Cox rsc@golang.org
|
CL out for review (why didn't Gerrit update this bug?): https://go-review.googlesource.com/13630 |
CL https://golang.org/cl/13630 mentions this issue. |
CL https://golang.org/cl/13650 mentions this issue. |
@randall77 The update come from a cron job. I think it's once an hour or something like that. |
Reopening because this change broke */arm64. Fix proposed in https://golang.org/cl/13650 |
Edit: the bug manifests on master.
The following code:
Another example:
prints 1152921504606850105 with go1.4 http://play.golang.org/p/mZ3HZnFP0E
and prints 3129 with the latest code on master
The text was updated successfully, but these errors were encountered: