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: found illegal assignment #49875

Closed
reusee opened this issue Nov 30, 2021 · 2 comments
Closed

cmd/compile: internal compiler error: found illegal assignment #49875

reusee opened this issue Nov 30, 2021 · 2 comments
Labels
NeedsInvestigation
Milestone

Comments

@reusee
Copy link

@reusee reusee commented Nov 30, 2021

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

$ go version
go version devel go1.18-18934e11ba Tue Nov 30 03:39:57 2021 +0000 darwin/arm64

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
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/reus/Library/Caches/go-build"
GOENV="/Users/reus/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/reus/pkg/mod"
GONOPROXY="github.com/reusee/*"
GONOSUMDB="github.com/reusee/*"
GOOS="darwin"
GOPATH="/Users/reus"
GOPRIVATE="github.com/reusee/*"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/Users/reus/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/reus/gotip/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="devel go1.18-18934e11ba Tue Nov 30 03:39:57 2021 +0000"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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/4r/qbq6ljvd4y3c89_zw3yr24v40000gn/T/go-build1913955240=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version devel go1.18-18934e11ba Tue Nov 30 03:39:57 2021 +0000 darwin/arm64
GOROOT/bin/go tool compile -V: compile version devel go1.18-18934e11ba Tue Nov 30 03:39:57 2021 +0000
uname -v: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000
ProductName:	macOS
ProductVersion:	12.0.1
BuildVersion:	21A559
lldb --version: lldb-1300.0.32.4
Swift version 5.5.1-dev

What did you do?

package main

func foo(args ...interface{}) {}

func main() {
	var args []any
	foo(args...)
}

What did you expect to see?

no error

What did you see instead?

./a.go:7:5: internal compiler error: found illegal assignment SLICE-[]any -> SLICE-[]interface {};

goroutine 1 [running]:
runtime/debug.Stack()
	/Users/reus/gotip/src/runtime/debug/stack.go:24 +0x68
cmd/compile/internal/base.FatalfAt({0x0?, 0x0?}, {0x10096ea93, 0x27}, {0x14000142db8, 0x3, 0x3})
	/Users/reus/gotip/src/cmd/compile/internal/base/print.go:227 +0x20c
cmd/compile/internal/base.Fatalf(...)
	/Users/reus/gotip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/noder.assignconvfn({0x100b928f8, 0x1400058e9c0}, 0x140005904d0)
	/Users/reus/gotip/src/cmd/compile/internal/noder/transform.go:426 +0x154
cmd/compile/internal/noder.typecheckaste(0x90?, {0x1400059c090?, 0x14000142ee8?}, 0x1, 0x1400059c090?, {0x1400037a1d0, 0x1, 0x1008b7518?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/transform.go:483 +0x1e8
cmd/compile/internal/noder.transformCall(0x1400059c090)
	/Users/reus/gotip/src/cmd/compile/internal/noder/transform.go:163 +0x1c0
cmd/compile/internal/noder.Call({0x59a000?, 0x140?}, 0x1400037a050?, {0x100b928f8, 0x1400058e5b0}, {0x1400037a1d0?, 0x1, 0x14000143018?}, 0x1)
	/Users/reus/gotip/src/cmd/compile/internal/noder/helpers.go:186 +0x22c
cmd/compile/internal/noder.(*irgen).expr0(0x1400059a000, {0x100b8e4c0, 0x0}, {0x100b8ed88?, 0x1400058c100?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/expr.go:117 +0x534
cmd/compile/internal/noder.(*irgen).expr(0x1400059a000, {0x100b8ed88?, 0x1400058c100?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/expr.go:81 +0x4f4
cmd/compile/internal/noder.(*irgen).stmt(0x1400059a000, {0x100b8ef08?, 0x1400058a160?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/stmt.go:40 +0xa34
cmd/compile/internal/noder.(*irgen).stmts(0x140005907e0?, {0x1400058a180?, 0x2, 0x0?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/stmt.go:19 +0x9c
cmd/compile/internal/noder.(*irgen).funcBody(0x1400059a000, 0x1400037c420, 0x1400012f640?, 0x1400058c080, 0x1400058c0c0)
	/Users/reus/gotip/src/cmd/compile/internal/noder/func.go:45 +0x224
cmd/compile/internal/noder.(*irgen).funcDecl.func1()
	/Users/reus/gotip/src/cmd/compile/internal/noder/decl.go:143 +0xb8
cmd/compile/internal/noder.(*irgen).generate(0x1400059a000, {0x14000102b00, 0x2, 0x10142cf40?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/irgen.go:280 +0x1f4
cmd/compile/internal/noder.check2({0x14000102b00, 0x2, 0x2})
	/Users/reus/gotip/src/cmd/compile/internal/noder/irgen.go:92 +0x130
cmd/compile/internal/noder.LoadPackage({0x14000132110, 0x2, 0x0?})
	/Users/reus/gotip/src/cmd/compile/internal/noder/noder.go:90 +0x2f0
cmd/compile/internal/gc.Main(0x100b89800)
	/Users/reus/gotip/src/cmd/compile/internal/gc/main.go:191 +0xbe0
main.main()
	/Users/reus/gotip/src/cmd/compile/main.go:55 +0xf8

@ALTree
Copy link
Member

@ALTree ALTree commented Nov 30, 2021

cc @danscales

@ALTree ALTree added this to the Go1.18 milestone Nov 30, 2021
@ALTree ALTree added the NeedsInvestigation label Nov 30, 2021
@ALTree ALTree changed the title cmd/compile: internal compiler error cmd/compile: internal compiler error: found illegal assignment Nov 30, 2021
@gopherbot
Copy link

@gopherbot gopherbot commented Nov 30, 2021

Change https://golang.org/cl/367754 mentions this issue: cmd/compile: make irgen emits Types[TINTER] for interface{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

3 participants