What version of Go are you using (go version)?

Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?


What did you do?
package main
// Closure .
func Closure(as []interface{}, bs []interface{}) {
_ = func() {
_ = as[:len(as)] // [L6:9] checked?
_ = bs[:len(bs)] // [L7:9] checked?
// swap
_ = as[:len(bs)] // checked, that's right.
_ = bs[:len(as)] // checked, that's right.
}
}
// NoClosure .
func NoClosure(as []interface{}, bs []interface{}) {
_ = as[:len(as)] // eliminatd, that's right.
_ = bs[:len(bs)] // eliminatd, that's right.
// swap
_ = as[:len(bs)] // checked, that's right.
_ = bs[:len(as)] // checked, that's right.
}
// ClosureAssert .
func ClosureAssert(as []interface{}, bs []interface{}) {
_ = func() {
if len(as) == len(bs) {
_ = as[:len(bs)] // [L27] eliminatd, why?
_ = bs[:len(as)] // [L28] eliminatd, why?
_ = as[:len(as)] // [L29:10] checked, why?
_ = bs[:len(bs)] // [L30:10] checked, why?
}
}
}
func main() {}
go build -gcflags="-d=ssa/check_bce/debug=1" main.go
What did you expect to see?
See the comments of the code above.
What did you see instead?

What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env)?What did you do?
go build -gcflags="-d=ssa/check_bce/debug=1" main.goWhat did you expect to see?
See the comments of the code above.
What did you see instead?