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: Unexpected op with CALL during stenciling: * #47878

Closed
reusee opened this issue Aug 22, 2021 · 3 comments
Closed
Milestone

Comments

@reusee
Copy link

@reusee reusee commented Aug 22, 2021

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

$ go version
go version devel go1.18-6e50991d2a Sat Aug 21 18:23:58 2021 +0000 windows/amd64

Does this issue reproduce with the latest release?

no

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

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\reus\AppData\Local\go-build
set GOENV=C:\Users\reus\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\reus\go\pkg\mod
set GONOPROXY=github.com/reusee/*
set GONOSUMDB=github.com/reusee/*
set GOOS=windows
set GOPATH=C:\Users\reus\go
set GOPRIVATE=github.com/reusee/*
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\Users\reus\gotip
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Users\reus\gotip\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=devel go1.18-6e50991d2a Sat Aug 21 18:23:58 2021 +0000
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
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 -fmessage-length=0 -fdebug-prefix-map=C:\Users\reus\AppData\Local\Temp\go-build3079967819=/tmp/go-build -gno-record-gcc-switches
GOROOT/bin/go version: go version devel go1.18-6e50991d2a Sat Aug 21 18:23:58 2021 +0000 windows/amd64
GOROOT/bin/go tool compile -V: compile version devel go1.18-6e50991d2a Sat Aug 21 18:23:58 2021 +0000

What did you do?

package main

type Src[T any] func() Src[T]

func (s *Src[T]) Next() {
	*s = (*s)()
}

func main() {
	var src Src[int]
	src.Next()
}

What did you expect to see?

no error

What did you see instead?

.\src.go:6:11: internal compiler error: Unexpected op with CALL during stenciling: *
@reusee
Copy link
Author

@reusee reusee commented Aug 22, 2021

Another possibly related error

package main

type Src[T any] func() Src[T]

func foo[T any](srcs ...Src[T]) {
	srcs[0]()
}

func main() {
	var src Src[int]
	foo(src)
}
.\src.go:6:10: internal compiler error: Unexpected op with CALL during stenciling: INDEX                                           

Loading

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 22, 2021

Change https://golang.org/cl/344210 mentions this issue: cmd/compile: fix stencil on calling a function ptr.

Loading

@reusee
Copy link
Author

@reusee reusee commented Aug 23, 2021

I just discovered the GOEXPERIMENT=unified knob. It runs fine with the flag enabled.

Loading

@toothrot toothrot added this to the Backlog milestone Aug 24, 2021
@gopherbot gopherbot closed this in 08d4cc2 Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants