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: cannot export SLICE2ARRPTR (21) node #45665

Closed
rogpeppe opened this issue Apr 21, 2021 · 1 comment
Closed

Comments

@rogpeppe
Copy link
Contributor

go version devel go1.17-f53c2fac46 Wed Apr 21 04:27:01 2021 +0000 linux/amd64

It appears that there's still a bit more work to be done on issue #395. This program gives an internal compiler error:

package main

func main() {
	Get([]string{"a", "b"})
}

func Get(ss []string) *[2]string {
	return (*[2]string)(ss)
}

The stack trace I get is:

<autogenerated>:1: internal compiler error: cannot export SLICE2ARRPTR (21) node
	==> please file an issue and assign to gri@

goroutine 1 [running]:
runtime/debug.Stack()
	/home/rogpeppe/go/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt(0xc0001254f0, 0xd4354d, 0xc0005cc820, 0xc0000a9538, 0x3000000c82280, 0x0)
	/home/rogpeppe/go/src/cmd/compile/internal/base/print.go:227 +0x157
cmd/compile/internal/base.Fatalf(...)
	/home/rogpeppe/go/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/typecheck.(*exportWriter).expr(0xffffffffffffffeb, 0xe7f0b0, 0xc0001254f0)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1833 +0x17d0
cmd/compile/internal/typecheck.(*exportWriter).exprList(0xc0001254a0, 0xc00011c230, 0x1, 0x1)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1442 +0x76
cmd/compile/internal/typecheck.(*exportWriter).stmt(0xc0001254a0, 0xe80438, 0xc0001254a0)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1341 +0x83f
cmd/compile/internal/typecheck.(*exportWriter).node(0xc000132270, 0xe80438, 0xc0001254a0)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1267 +0x65
cmd/compile/internal/typecheck.(*exportWriter).stmtList(0xc0000a96c0, 0xc00011c210, 0x1, 0xc0000885a0)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1260 +0x76
cmd/compile/internal/typecheck.(*exportWriter).funcBody(0xc0000a9710, 0xc00011e2c0)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1255 +0x5b
cmd/compile/internal/typecheck.(*iexporter).doInline(0x0, 0xc0001260e4)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:550 +0xc5
cmd/compile/internal/typecheck.(*exportWriter).funcExt(0xe7ff88, 0xc0001320d0)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:1192 +0x13a
cmd/compile/internal/typecheck.(*iexporter).doDecl(0xc0007ea140, 0x4620fb)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:463 +0x16f
cmd/compile/internal/typecheck.WriteExports(0xc0005e0880)
	/home/rogpeppe/go/src/cmd/compile/internal/typecheck/iexport.go:279 +0x269
cmd/compile/internal/gc.dumpexport(0xc000377000)
	/home/rogpeppe/go/src/cmd/compile/internal/gc/export.go:39 +0x1c5
cmd/compile/internal/gc.dumpCompilerObj(0x7ffdd7019ab4)
	/home/rogpeppe/go/src/cmd/compile/internal/gc/obj.go:106 +0x28
cmd/compile/internal/gc.dumpobj1(0x7ffdd7019ab4, 0xc0000a9bdc, 0x3)
	/home/rogpeppe/go/src/cmd/compile/internal/gc/obj.go:62 +0x17b
cmd/compile/internal/gc.dumpobj()
	/home/rogpeppe/go/src/cmd/compile/internal/gc/obj.go:43 +0x36
cmd/compile/internal/gc.Main(0xd4aae0)
	/home/rogpeppe/go/src/cmd/compile/internal/gc/main.go:307 +0x105b
main.main()
	/home/rogpeppe/go/src/cmd/compile/main.go:55 +0xdd
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/312070 mentions this issue: cmd/compile: allow export/import OSLICE2ARRPTR

@golang golang locked and limited conversation to collaborators Apr 21, 2022
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

3 participants