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/go: go build internal compiler error #53559

Closed
toy80 opened this issue Jun 27, 2022 · 2 comments
Closed

cmd/go: go build internal compiler error #53559

toy80 opened this issue Jun 27, 2022 · 2 comments

Comments

@toy80
Copy link

toy80 commented Jun 27, 2022

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

go version go1.18.2 linux/amd64
go version go1.18 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
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB="*"
GOOS="linux"
GOPRIVATE=""
GOPROXY=
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/c/w/compiler_error/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2088256825=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I made a test case, build it with -race and -gcflags=all="-l -N", then an "internal compiler error" occurs.

package bar

type A[T any] struct {
	X, Y int
}

func (A[T]) Wtf() {}

func Bar[T any]() any {
	return A[T]{}
}
package foo

import (
	"test1/bar"
)

func Foo() {
	bar.Bar[int]()
}
module test1

go 1.18

go build -race -gcflags=all="-l -N" ./foo

What did you expect to see?

nothing

What did you see instead?

test1/foo
<autogenerated>:1: internal compiler error: dictionary for A[go.shape.int_0].Wtf should only use concrete types: go.shape.int_0

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
@toy80 toy80 changed the title go build internal compiler error cmd/go: go build internal compiler error Jun 27, 2022
@ZekeLu
Copy link
Contributor

ZekeLu commented Jun 27, 2022

This issue has been fixed by 5b4fafd

@ianlancetaylor
Copy link
Contributor

Thanks.

@ianlancetaylor ianlancetaylor closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2022
@golang golang locked and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants