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 CLOSURE (34) node #24120

Closed
ALTree opened this issue Feb 25, 2018 · 4 comments
Closed

cmd/compile: internal compiler error: cannot export CLOSURE (34) node #24120

ALTree opened this issue Feb 25, 2018 · 4 comments

Comments

@ALTree
Copy link
Member

ALTree commented Feb 25, 2018

$ gotip version
go version devel +7a218942be Sat Feb 24 23:13:03 2018 +0000 linux/amd64

From gosmith:

package p

var F func(int)

func G() {
	if F(func() int { return 1 }()); false {
	}
}

gotip build test.go:

# command-line-arguments
<autogenerated>:1:0: internal compiler error: cannot export CLOSURE (34) node
==> please file an issue and assign to gri@


goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
	/go/src/runtime/debug/stack.go:24 +0xa7
cmd/compile/internal/gc.Fatalf(0xc4469b, 0x47, 0xc0004b9180, 0x2, 0x2)
	/go/src/cmd/compile/internal/gc/subr.go:182 +0x1fc
cmd/compile/internal/gc.(*exporter).expr(0xc0004b95f0, 0xc000001380)
	/go/src/cmd/compile/internal/gc/bexport.go:1478 +0x263
cmd/compile/internal/gc.(*exporter).expr(0xc0004b95f0, 0xc00032b000)
	/go/src/cmd/compile/internal/gc/bexport.go:1421 +0x71b
cmd/compile/internal/gc.(*exporter).exprList(0xc0004b95f0, 0xc000321ee0)
	/go/src/cmd/compile/internal/gc/bexport.go:1225 +0xa9
cmd/compile/internal/gc.(*exporter).expr(0xc0004b95f0, 0xc00032ac80)
	/go/src/cmd/compile/internal/gc/bexport.go:1422 +0x73a
cmd/compile/internal/gc.(*exporter).stmtList(0xc0004b95f0, 0xc000321f00)
	/go/src/cmd/compile/internal/gc/bexport.go:1204 +0x111
cmd/compile/internal/gc.(*exporter).stmt(0xc0004b95f0, 0xc00032ac00)
	/go/src/cmd/compile/internal/gc/bexport.go:1558 +0x646
cmd/compile/internal/gc.(*exporter).stmtList(0xc0004b95f0, 0xc00035a1e0)
	/go/src/cmd/compile/internal/gc/bexport.go:1202 +0x101
cmd/compile/internal/gc.export(0xc0004da4c0, 0xc24200, 0x5)
	/go/src/cmd/compile/internal/gc/bexport.go:400 +0x936
cmd/compile/internal/gc.dumpexport(0xc0004fc190)
	/go/src/cmd/compile/internal/gc/export.go:254 +0x8c
cmd/compile/internal/gc.dumpobj1(0x7ffdb95a02f1, 0x23, 0x3)
	/go/src/cmd/compile/internal/gc/obj.go:94 +0x993
cmd/compile/internal/gc.dumpobj()
	/go/src/cmd/compile/internal/gc/obj.go:50 +0x61
cmd/compile/internal/gc.Main(0xc474e0)
	/go/src/cmd/compile/internal/gc/main.go:675 +0x2b09
main.main()
	/go/src/cmd/compile/main.go:49 +0x95

Introduced in 2dbf15e. cc @aclements

@ALTree ALTree added this to the Go1.11 milestone Feb 25, 2018
@ALTree
Copy link
Member Author

ALTree commented Feb 25, 2018

Also cc @griesemer in case aclement's CL just exposed a pre-existing issue.

@gopherbot
Copy link

Change https://golang.org/cl/97415 mentions this issue: cmd/compile: export/import OCLOSURE

@mdempsky
Copy link
Member

The issue is in hairyVisitor, now we're skipping visiting Ninit if the condition is constant, so it's not able to complain that OCLOSUREs aren't exportable. We just need to restore that.

@gopherbot
Copy link

Change https://golang.org/cl/97475 mentions this issue: cmd/compile: fix inlining of constant if statements

@golang golang locked and limited conversation to collaborators Feb 27, 2019
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