Skip to content

go compiler #54141

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

Closed
nabetani opened this issue Jul 30, 2022 · 2 comments
Closed

go compiler #54141

nabetani opened this issue Jul 30, 2022 · 2 comments

Comments

@nabetani
Copy link

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

$ go version
go version go1.18.4 darwin/arm64

Does this issue reproduce with the latest release?

1.18.1〜1.18.3: no problem
1.18.4: compiler says internal compiler error: assertion failed

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/XXXX/Library/Caches/go-build"
GOENV="/Users/XXXX/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/XXXX/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/XXXX/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.18.4/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.18.4/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/XXXX/github/nabetani/killgo/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/8x/qzrby60s6y9b_tfc5qgrkmn00000gn/T/go-build940903455=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I ran following code.

package main

import "log"

type Obj interface{ Hoge() string }
type objType struct{}

func Send[T Obj](obj T) {
	func() { obj.Hoge() }()
}

func foo(o Obj) { Send(o) }

func (o *objType) Hoge() string {
	log.Println("objType.Hoge")
	return "objType.Hoge"
}

func main() { foo(&objType{}) }

I expected following:

$ go run main.go
2022/07/30 20:08:42 objType.Hoge

What did you see instead?

I got following:

$ go run main.go
# command-line-arguments
./main.go:9:19: internal compiler error: assertion failed

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

I tried other versions:

$ go1.18.1 run main.go 
2022/07/30 20:12:04 objType.Hoge
$ go1.18.2 run main.go
2022/07/30 20:12:07 objType.Hoge
$ go1.18.3 run main.go
2022/07/30 20:12:10 objType.Hoge
$ go1.18.4 run main.go
# command-line-arguments
./main.go:9:19: internal compiler error: assertion failed

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

go version devel go1.19-9a2001a8cc Fri Jul 29 22:09:32 2022 +0000 darwin/arm64
the master seems to be ok!

@seankhliao
Copy link
Member

Duplicate of #53762

@seankhliao seankhliao marked this as a duplicate of #53762 Jul 30, 2022
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2022
@golang golang locked and limited conversation to collaborators Jul 30, 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