Closed
Description
$ gotip version
go version devel go1.21-942c1c1 Tue Jun 27 18:21:24 2023 +0000 linux/amd64
package p
func f(x int, b bool) int {
switch x {
case 0:
return 0
case 1:
return 1
case 2:
return 2
// ...
// ~100 other cases
// ...
case 100:
return 100
case 101:
return 101
case 102:
return 102
}
if b {
var a struct{ f int64 }
_ = max(0, a.f)
}
return min(0, len(append([]int{}, []int{}...)))
}
(full reproducer here: https://go.dev/play/p/_bv7gsRF91v?v=gotip)
$ GOARCH=386 gotip build main.go
# command-line-arguments
./main.go:106:7: internal compiler error: 'f': not lowered: v654, Int64Hi INT32 INT
goroutine 9 [running]:
runtime/debug.Stack()
./desktop/gotip/src/runtime/debug/stack.go:24 +0x5e
cmd/compile/internal/base.FatalfAt({0x6318d8?, 0xc0?}, {0xc0006318b0, 0x8}, {0xc0005c0fe0, 0x2, 0x2})
./desktop/gotip/src/cmd/compile/internal/base/print.go:230 +0x1d7
cmd/compile/internal/base.Fatalf(...)
./desktop/gotip/src/cmd/compile/internal/base/print.go:199
cmd/compile/internal/ssagen.(*ssafn).Fatalf(0x10?, {0xc352c108?, 0x7f45?}, {0xd650f5, 0x2}, {0xc0005f3db0, 0x1, 0xc00002e4e0?})
./desktop/gotip/src/cmd/compile/internal/ssagen/ssa.go:7994 +0x16a
cmd/compile/internal/ssa.(*Func).Fatalf(0xc0003cf380, {0xd650f5, 0x2}, {0xc0005f3db0, 0x1, 0x1})
./desktop/gotip/src/cmd/compile/internal/ssa/func.go:716 +0x279
cmd/compile/internal/ssa.checkLower(0xc0003cf380)
./desktop/gotip/src/cmd/compile/internal/ssa/lower.go:49 +0x405
cmd/compile/internal/ssa.Compile(0xc0003cf380)
./desktop/gotip/src/cmd/compile/internal/ssa/compile.go:97 +0x9ab
cmd/compile/internal/ssagen.buildssa(0xc0003ffe40, 0x3)
./desktop/gotip/src/cmd/compile/internal/ssagen/ssa.go:568 +0x2b09
cmd/compile/internal/ssagen.Compile(0xc0003ffe40, 0x0?)
./desktop/gotip/src/cmd/compile/internal/ssagen/pgen.go:187 +0x45
cmd/compile/internal/gc.compileFunctions.func5.1(0xc0003f3900?)
./desktop/gotip/src/cmd/compile/internal/gc/compile.go:184 +0x34
cmd/compile/internal/gc.compileFunctions.func3.1()
./desktop/gotip/src/cmd/compile/internal/gc/compile.go:166 +0x30
created by cmd/compile/internal/gc.compileFunctions.func3 in goroutine 8
./desktop/gotip/src/cmd/compile/internal/gc/compile.go:165 +0x23a
fails on GOARCH=arm
too.