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
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@reusee
Copy link

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 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                                           

@gopherbot
Copy link

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

@reusee
Copy link
Author

reusee commented Aug 23, 2021

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

@toothrot toothrot added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Aug 24, 2021
@toothrot toothrot added this to the Backlog milestone Aug 24, 2021
@golang golang locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

3 participants