go: cmd/compile: internal compiler error: Value live at entry. It shouldn't be.

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

$ go version
go version go1.18.1 windows/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=      
set GOCACHE=C:\Users\ddaa\AppData\Local\go-build
set GOENV=C:\Users\ddaa\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\ddaa\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\ddaa\go
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.18.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\programing\go\bugReview\go.mod
set GOWORK=
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\ddaa\AppData\Local\Temp\go-build1175442941=/tmp/go-build -gno-rec
ord-gcc-switches

What did you do?

https://go.dev/play/p/sgQ1Oc01pz2

What did you expect to see?

compile successfully

What did you see instead?

./prog.go:9:6: internal compiler error: 'main': Value live at entry. It shouldn't be. func main, node .autotmp_5, value v118

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

Go build failed.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (15 by maintainers)

Most upvoted comments

@cuonglm Thanks. Do you want to take this issue?

Yes, no problem!

Generally ICEs that are triggered only by fuzzing the compiler don’t need backporting. If it generated bad code, then maybe.

This isn’t a Go 1.18 regression. I don’t think it needs to be backported.

@cuonglm Thanks. Do you want to take this issue?

@mdempsky Seems the bug was introduced when the compiler was changed to handle array literal with more than 4 elements. This program:

package p

type b bool

func f() {
	func() [10][]bool {
		return [10][]bool{
			[]bool{bool(g(false) < "")},
			[]bool{}, []bool{}, []bool{}, []bool{}}
	}()
}

func g(b) (s string) { return }

compile ok with go1.4 😃

@ianlancetaylor This is different bug involve initialization of composite literal.