-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: function compiled without bounds checking and -1 index access #27251
Comments
This is a regression. On linux/amd64:
|
This correctly panics with Go 1.10. I think this needs to be fixed in the next release of Go 1.11. cc @rasky @dr2chase @aclements (who I think worked on bound check elimination.) |
-1 index access is too specific, the error is cumulative. The example below outputs https://play.golang.org/p/pvSfKcoi6_2 // output on go1.11
|
A few of us in the Gofrs group were talking about this, and managed to bisect it down to e0d37a3:
|
I've got a revert ready, not skilled at submitting CLs off head, also doing a round of benchmarking just in case it's got horrible effects. |
@dr2chase if you want a hand wrangling the CL, ping me (google chat? email?) and we can meet up |
Change https://golang.org/cl/131936 mentions this issue: |
@gopherbot please file this for backport against 1.11. This is a regression. @dr2chase please make a cherry-pick CL once your change is merged in master. |
Backport issue(s) opened: #27378 (for 1.11). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/132436 mentions this issue: |
Change https://golang.org/cl/132495 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.11 windows/amd64
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOCACHE=...
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=...
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=... -gno-record-gcc-switches
What did you do?
I compiled the following functions: https://play.golang.org/p/FstWIAwJwdg
What did you expect to see?
I expected two things:
What did you see instead?
The text was updated successfully, but these errors were encountered: