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: shape types have no methods SomeFunc[go.shape.[]uint8] #56923

Open
csgura opened this issue Nov 24, 2022 · 2 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@csgura
Copy link

csgura commented Nov 24, 2022

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

$ gotip version
go version devel go1.20-920f87adda Wed Nov 23 23:15:01 2022 +0000 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/gura/Library/Caches/go-build"
GOENV="/Users/gura/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/gura/go/pkg/mod"
GONOPROXY="*.uangel.com"
GONOSUMDB="*.uangel.com"
GOOS="darwin"
GOPATH="/Users/gura/go"
GOPRIVATE="*.uangel.com"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/Users/gura/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/gura/sdk/gotip/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="devel go1.20-920f87adda Wed Nov 23 23:15:01 2022 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/gura/git/eqerr/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mr/dvhjg7zd4l125pln73bqyr400000gp/T/go-build2913625895=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

https://go.dev/play/p/5idmax6nM9k?v=gotip

What did you expect to see?

No error.

What did you see instead?

$ gotip run main.go 
go build gotiperr/eq: # gotiperr/eq
eq/eq_op.go:12:5: internal compiler error: shape types have no methods fp.EqFunc[go.shape.[]uint8]

goroutine 1 [running]:
runtime/debug.Stack()
	/Users/gura/sdk/gotip/src/runtime/debug/stack.go:24 +0x64
cmd/compile/internal/base.FatalfAt({0x475268?, 0x140?}, {0x104ee87f0, 0x1f}, {0x14000475278, 0x1, 0x1})
	/Users/gura/sdk/gotip/src/cmd/compile/internal/base/print.go:227 +0x1fc
cmd/compile/internal/base.Fatalf(...)
	/Users/gura/sdk/gotip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/reflectdata.MarkTypeUsedInInterface(0x14000469b20, 0x1400047d080)
	/Users/gura/sdk/gotip/src/cmd/compile/internal/reflectdata/reflect.go:2072 +0x6c
cmd/compile/internal/staticinit.(*Schedule).StaticAssign(0x14000475a30, 0x1400045abb0, 0x0, {0x105112a80?, 0x1400036f3b0?}, 0x1400044b420)
	/Users/gura/sdk/gotip/src/cmd/compile/internal/staticinit/sched.go:336 +0x894
cmd/compile/internal/staticinit.(*Schedule).staticAssignInlinedCall(0x1400047d000?, 0x1400045abb0, 0x78?, 0x14000477960, 0x14000475678?)
	/Users/gura/sdk/gotip/src/cmd/compile/internal/staticinit/sched.go:619 +0x8c8
cmd/compile/internal/staticinit.(*Schedule).StaticAssign(0x14000475a30, 0x1400045abb0, 0x0, {0x105113268?, 0x14000477960?}, 0x1400044b420)
	/Users/gura/sdk/gotip/src/cmd/compile/internal/staticinit/sched.go:371 +0x334
cmd/compile/internal/staticinit.(*Schedule).tryStaticInit(0x1400047ae70?, {0x105112298, 0x1400046a9b0})
	/Users/gura/sdk/gotip/src/cmd/compile/internal/staticinit/sched.go:77 +0x15c
cmd/compile/internal/staticinit.(*Schedule).StaticInit(0x14000475a30, {0x105112298?, 0x1400046a9b0})
	/Users/gura/sdk/gotip/src/cmd/compile/internal/staticinit/sched.go:50 +0x2c
cmd/compile/internal/pkginit.Task()
	/Users/gura/sdk/gotip/src/cmd/compile/internal/pkginit/init.go:151 +0x860
cmd/compile/internal/gc.Main(0x1051070b0)
	/Users/gura/sdk/gotip/src/cmd/compile/internal/gc/main.go:282 +0xff4
main.main()
	/Users/gura/sdk/gotip/src/cmd/compile/main.go:57 +0xdc
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Nov 24, 2022
@cuonglm
Copy link
Member

cuonglm commented Nov 24, 2022

Seems relate to inl static init optimization, code runs ok with the optimization disabled:

go run -gcflags=all=-d=inlstaticinit=0 main.go

@cuonglm cuonglm added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 24, 2022
@cuonglm cuonglm added this to the Go1.20 milestone Nov 24, 2022
@cuonglm cuonglm self-assigned this Nov 24, 2022
@gopherbot
Copy link

gopherbot commented Nov 24, 2022

Change https://go.dev/cl/453315 mentions this issue: cmd/compile: fix inline static init with derived types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants