Closed
Description
package main
func f(x int) int {
if x >= 1000 {
return max(x, 2000)
}
switch x {
case 0:
return 0
case 1:
return 1
case 2:
return 2
... 996 more cases ...
case 999:
return 999
}
return 0
}
This program causes the compiler to crash on tip. The problem stems from an incompatibility between how max
is implemented and the phi placement algorithm we use for large functions (hence the need for all the switch cases to reproduce it).