Skip to content

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

Closed

Description

@ALTree
$ 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

Activity

  1. added this to the Go1.11 milestone on Feb 25, 2018
  2. ALTree commented on Feb 25, 2018

    @ALTree
    MemberAuthor

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

  3. gopherbot commented on Feb 27, 2018

    @gopherbot
    Contributor

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

  4. mdempsky commented on Feb 27, 2018

    @mdempsky
    Contributor

    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.

  5. gopherbot commented on Feb 27, 2018

    @gopherbot
    Contributor

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

  6. locked and limited conversation to collaborators on Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions