LLVM ERROR: Cannot select: intrinsic %llvm.coro.size
ALTree opened this issue · 5 comments
$ tinygo version
tinygo version 0.16.0 linux/amd64 (using go version go1.15.8 and LLVM version 10.0.1)
package main
func main() {
var ch chan string
var m map[byte]string
_ = m[0]
_ = <-ch
}
$ tinygo build -o out crash.go
LLVM ERROR: Cannot select: intrinsic %llvm.coro.size
Is that actually valid Go code?
fatal error: all goroutines are asleep - deadlock!
goroutine 1 [chan receive (nil chan)]:
main.main()
/tmp/sandbox401551102/prog.go:7 +0x65
Program exited: status 2.
It is valid in the sense that it is well defined: a program like this is defined to exit with a panic. This is certainly a compiler bug, either in TinyGo or in LLVM.
@deadprogram Yes, it's valid, in the sense that it conforms to the Go Specification.
As @aykevl pointed out, in general a compiler shouldn't crash when compiling valid -or invalid- Go code. Valid code should generate a binary, which then may or may not panic at runtime, like mine does; invalid Go code should print a compilation error. In this case LLVM is crashing while processing a valid Go program, so this can be classified as a compiler bug.
This should be addressed now that coroutines are no longer used (and will be removed by #2174 )
Confirmed fixed on 0.25