golang/go

cmd/compile: internal compiler error: missed typecheck

ALTree opened this issue · 3 comments

$ go version
go version go1.21.0 linux/amd64

$ gotip version
go version devel go1.22-a3ced4a Wed Aug 9 03:13:11 2023 +0000 linux/amd64
package p

func f(p []byte) int {
	switch "" < string(p) {
	case true:
		return 0
	default:
		return 1
	}
}
$ go build crash.go 

# command-line-arguments
./crash.go:4:12: internal compiler error: missed typecheck: 
.   LEN int # crash.go:4:12
.   .   NAME-p.p esc(no) Class:PPARAM Offset:0 OnStack Used SLICE-[]byte tc(1) # crash.go:3:8

cc @golang/compiler @cuonglm

Change https://go.dev/cl/517936 mentions this issue: cmd/compile: make backingArrayPtrLen to return typecheck-ed nodes

@gopherbot Please backport this to go1.21

Backport issue(s) opened: #61909 (for 1.21).

Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.