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: generic type cause "internal compiler error: 'main': Value live at entry. It shouldn't be." #56652

Closed
weirenxue opened this issue Nov 8, 2022 · 2 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@weirenxue
Copy link

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

$ go version
go version go1.19.3 darwin/arm64

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
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/wrxue/Library/Caches/go-build"
GOENV="/Users/wrxue/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/wrxue/.gvm/pkgsets/go1.19.3/global/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/wrxue/.gvm/pkgsets/go1.19.3/global"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/wrxue/.gvm/gos/go1.19.3"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/wrxue/.gvm/gos/go1.19.3/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.19.3"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/wrxue/dev_area/self/go-generic/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0n/s_bn25kd57n34cn4zfq_45fc0000gn/T/go-build3162168903=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Generic types cause compiler error: https://go.dev/play/p/_j9MRr7EBZG

However, it compiles well without generic types: https://go.dev/play/p/3VMHGTkfDUE

What did you expect to see?

I would like to see the same result for code with generic types as for code without generic types.

What did you see instead?

"internal compiler error: 'main': Value live at entry. It shouldn't be."

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 8, 2022
@mknyszek
Copy link
Contributor

mknyszek commented Nov 8, 2022

CC @golang/compiler

@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 8, 2022
@mknyszek mknyszek added this to the Backlog milestone Nov 8, 2022
@mdempsky
Copy link
Contributor

mdempsky commented Nov 8, 2022

This seems like a duplicate of #54911.

Either way, this is fixed on the dev branch due to the switch to GOEXPERIMENT=unified, which is planned for inclusion in Go 1.20. We're unlikely to backport a fix to 1.18/1.19, sorry.

@mdempsky mdempsky closed this as completed Nov 8, 2022
@golang golang locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants