-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.
Milestone
Description
package main
func g() bool
func f(y int) bool {
b, ok := true, false
if y > 1 {
ok = g()
}
if !ok {
ok = g()
b = false
}
if !ok {
return false
}
return b
}
> go tool compile test.go
/home/khr/gowork/test.go:7:9: internal compiler error: 'f': panic during phiopt while compiling f:
runtime error: index out of range [-1]
goroutine 7 [running]:
cmd/compile/internal/ssa.Compile.func1(0xc00041ce38, 0xc0003ea4e0)
/home/khr/sandbox/ro/src/cmd/compile/internal/ssa/compile.go:48 +0x9f
panic(0xe06620, 0xc000026960)
/home/khr/sandbox/ro/src/runtime/panic.go:1031 +0x25b
cmd/compile/internal/ssa.convertPhi(0xc0004b6d60, 0xc000480bd0, 0xffffffffffffffff)
/home/khr/sandbox/ro/src/cmd/compile/internal/ssa/phiopt.go:318 +0x1aa
cmd/compile/internal/ssa.phiopt(0xc0003ea4e0)
/home/khr/sandbox/ro/src/cmd/compile/internal/ssa/phiopt.go:216 +0x2bc
cmd/compile/internal/ssa.Compile(0xc0003ea4e0)
/home/khr/sandbox/ro/src/cmd/compile/internal/ssa/compile.go:96 +0xc76
cmd/compile/internal/ssagen.buildssa(0xc000144420, 0x0, 0x0)
/home/khr/sandbox/ro/src/cmd/compile/internal/ssagen/ssa.go:629 +0x22e5
cmd/compile/internal/ssagen.Compile(0xc000144420, 0x0)
/home/khr/sandbox/ro/src/cmd/compile/internal/ssagen/pgen.go:151 +0x5f
cmd/compile/internal/gc.compileFunctions.func2.1(0xc0000323f0, 0xc000144420, 0xc00000e510, 0xc000023100)
/home/khr/sandbox/ro/src/cmd/compile/internal/gc/compile.go:130 +0x65
created by cmd/compile/internal/gc.compileFunctions.func2
/home/khr/sandbox/ro/src/cmd/compile/internal/gc/compile.go:128 +0x8e
Should be a simple fix.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.