Skip to content
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: internal compiler error: unexpected stmt: nil #50315

Closed
LukeShu opened this issue Dec 22, 2021 · 2 comments
Closed

cmd/compile: internal compiler error: unexpected stmt: nil #50315

LukeShu opened this issue Dec 22, 2021 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@LukeShu
Copy link

LukeShu commented Dec 22, 2021

What version of Go are you using (go version)?

$ go version
go version go1.17.5 linux/amd64

Does this issue reproduce with the latest release?

Yes, 1.17.5 is the latest release.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/lukeshu/.cache/go-build"
GOENV="/home/lukeshu/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/lukeshu/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/lukeshu/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.17.5"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/lukeshu/src/github.com/datawire/pyc-dis/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/run/user/1000/tmpdir/go-build1874362547=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://go.dev/play/p/W8yLp8Nstp-

What did you expect to see?

./prog.go:20:3: nil evaluated but not used

Go build failed.

What did you see instead?

./prog.go:18:2: internal compiler error: unexpected stmt: nil

Please file a bug report including a short program that triggers the error.
https://golang.org/issue/new

Go build failed.
@ianlancetaylor
Copy link
Contributor

This gets an internal compiler error on 1.17 but works on tip (works in the sense that the compiler reports the error "nil is not used"). Since this is invalid code, and this is fixed on tip, and the error is not so bad in 1.17, I'm not sure it's worth backporting a fix. Happy to hear other opinions.

@dmitshur dmitshur added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Dec 22, 2021
@dmitshur
Copy link
Contributor

Since this issue is resolved on tip, I'll move it to that milestone and close it as fixed. It can still be considered for backport to 1.17 and 1.16 (if 1.16 is affected), but I do not think it would meet the bar for the reasons Ian described. Thank you for reporting it, though.

@dmitshur dmitshur added this to the Go1.18 milestone Dec 22, 2021
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Dec 22, 2021
@golang golang locked and limited conversation to collaborators Dec 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants