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 go.shape.int_0 -> main.F.T #53439

Open
ALTree opened this issue Jun 18, 2022 · 2 comments
Assignees
Labels
NeedsFix
Milestone

Comments

@ALTree
Copy link
Member

@ALTree ALTree commented Jun 18, 2022

$ gotip version
go version devel go1.19-527ace0ffa Sat Jun 18 00:48:50 2022 +0000 linux/amd64
package main

import "unsafe"

func F[T int](v T) uintptr {
	return unsafe.Offsetof(struct{ f T }{
		func(T) T { return v }(v),
	}.f)
}

func main() {
	println(F(1))
}
$ gotip build crash.go
# command-line-arguments
./crash.go:7:25: internal compiler error: found illegal assignment go.shape.int_0 -> main.F.T; 

goroutine 1 [running]:
runtime/debug.Stack()
	./gotip/src/runtime/debug/stack.go:24 +0x65
cmd/compile/internal/base.FatalfAt({0x0?, 0x0?}, {0xd560d3, 0x27}, {0xc000412468, 0x3, 0x3})
	./gotip/src/cmd/compile/internal/base/print.go:227 +0x1d7
cmd/compile/internal/base.Fatalf(...)
	./gotip/src/cmd/compile/internal/base/print.go:196
cmd/compile/internal/noder.assignconvfn({0xeadd88, 0xc0003fdb80}, 0xc0003e12d0)
	./gotip/src/cmd/compile/internal/noder/transform.go:482 +0x1b2
cmd/compile/internal/noder.typecheckaste(0xc0?, {0xc0001726c0?, 0xeacb90?}, 0x0, 0x0?, {0xc00005ef80, 0x1, 0xc00005ef80?})
	./gotip/src/cmd/compile/internal/noder/transform.go:558 +0x16b
cmd/compile/internal/noder.transformCall(0xc0001726c0)
	./gotip/src/cmd/compile/internal/noder/transform.go:188 +0x1b6
cmd/compile/internal/noder.(*subster).node.func1({0xeacb90, 0xc000172240})
	./gotip/src/cmd/compile/internal/noder/stencil.go:1135 +0xe13
cmd/compile/internal/ir.editNodes(...)
	./gotip/src/cmd/compile/internal/ir/node_gen.go:1388
cmd/compile/internal/ir.(*CompLitExpr).editChildren(0xc000418380, 0xc000011db8)
	./gotip/src/cmd/compile/internal/ir/node_gen.go:359 +0xf5
cmd/compile/internal/ir.EditChildren(...)
	./gotip/src/cmd/compile/internal/ir/visit.go:185
cmd/compile/internal/noder.(*subster).node.func1({0xeace70, 0xc0003e1b90})
	./gotip/src/cmd/compile/internal/noder/stencil.go:994 +0x5b6
cmd/compile/internal/ir.(*SelectorExpr).editChildren(0xc000069d40, 0xc000011db8)
	./gotip/src/cmd/compile/internal/ir/node_gen.go:1012 +0x62
cmd/compile/internal/ir.EditChildren(...)
	./gotip/src/cmd/compile/internal/ir/visit.go:185
cmd/compile/internal/noder.(*subster).node.func1({0xeae348, 0xc000069bc0})
	./gotip/src/cmd/compile/internal/noder/stencil.go:994 +0x5b6
cmd/compile/internal/ir.editNodes(...)
	./gotip/src/cmd/compile/internal/ir/node_gen.go:1388

...

Likely related to #53390, either uncovered or caused by its fix.

@ALTree ALTree added the NeedsInvestigation label Jun 18, 2022
@ALTree ALTree added this to the Go1.19 milestone Jun 18, 2022
@ALTree
Copy link
Member Author

@ALTree ALTree commented Jun 18, 2022

(does not crash on UNIFIED)

@cuonglm cuonglm self-assigned this Jun 18, 2022
@cuonglm cuonglm added NeedsFix and removed NeedsInvestigation labels Jun 18, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Jun 18, 2022

Change https://go.dev/cl/413114 mentions this issue: cmd/compile: only skip visit closures in generic function call

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

No branches or pull requests

3 participants