golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.15k stars 17.69k forks source link

cmd/compile: out of fixed registers on 386 #13277

Closed dvyukov closed 8 years ago

dvyukov commented 9 years ago

The program is:

package p

var Var3629 = [2]int{}
var Var3555 = [0]int{}
var Var2673 = [][]int{}
var Var2515 = (([...][]func(float64,complex64,error,byte) func([][]float64,[0]interface {  Method2486 (complex64,complex64) (interface{},uint,byte,string)
},uint,map[error]complex64) [2][][]*[2]chan int{[]func(float64,complex64,error,byte) func([][]float64,[0]interface {  Method2486 (complex64,complex64) (interface{},uint,byte,string)
},uint,map[error]complex64) [2][][]*[2]chan int{},[]func(float64,complex64,error,byte) func([][]float64,[0]interface {  Method2486 (complex64,complex64) (interface{},uint,byte,string)
},uint,map[error]complex64) [2][][]*[2]chan int{}})[(((func(error,uintptr,chan [1]bool,float32) struct { Field2544 int
})(nil))(error(nil),uintptr(0),make(chan [1]bool ),float32(1.0))).Field2544])[((Var2673)[(int)(((((*((*((*((([][0]***[0][1][1]int16{})[(Var3555)[((struct { Field3609 int
}{})).Field3609]])[((func(int16) int)(nil))(int16(1))])))))))[(<- make(chan int ,1))])[(((([][1][1]int{})[(<- make(chan int ,1))])[(Var3629)[(make(map[[1]bool]int ,1))[[1]bool{}]]])[0]) + (1)])[(<- make(chan int ))] ,)])[(<- make(chan int ))]](1.0,complex64(1i),error(nil),byte(0))
$ GOARCH=386 go build test.go
test.go:11: internal compiler error: out of fixed registers

go version devel +25a28da Sun Nov 15 23:41:28 2015 +0000 linux/amd64

Found with GoSmith (https://github.com/dvyukov/gosmith).

piotrnar commented 8 years ago

Can someone please fix this already, or at least plan to get it fixed?

I was hoping to see it fixed in 1.7, but still the same bloody error. The only difference is that now I get the callstack dump.

..\lib\secp256k1\field.go:41: internal compiler error: out of fixed registers

goroutine 1 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
        c:/go/src/runtime/debug/stack.go:24 +0x80
cmd/compile/internal/gc.Fatalf(0x932975, 0x16, 0x0, 0x0, 0x0)
        c:/go/src/cmd/compile/internal/gc/subr.go:165 +0x216
cmd/compile/internal/gc.Regalloc(0x1b7ff200, 0x1300cb80, 0x1b7ff140)
        c:/go/src/cmd/compile/internal/gc/gsubr.go:749 +0x3a1
cmd/compile/internal/x86.ginscmp(0x91a13e, 0x1300cb80, 0x1b7ff080, 0x1b7ff140, 0x1, 0x11917a08)
        c:/go/src/cmd/compile/internal/x86/gsubr.go:657 +0x3a4
cmd/compile/internal/gc.Agenr(0x133b6de0, 0x1b7fea80, 0x1b7fea20)
        c:/go/src/cmd/compile/internal/gc/cgen.go:1245 +0x2489
cmd/compile/internal/gc.Igen(0x133b6de0, 0x1b7fea80, 0x1b7fea20)
        c:/go/src/cmd/compile/internal/gc/cgen.go:1718 +0x25a
cmd/compile/internal/gc.cgen_wb(0x133b6de0, 0x1b7fea20, 0x1b7fea00)
        c:/go/src/cmd/compile/internal/gc/cgen.go:523 +0x3ad4
cmd/compile/internal/gc.Cgen(0x133b6de0, 0x1b7fea20)
        c:/go/src/cmd/compile/internal/gc/cgen.go:19 +0x2e
cmd/compile/internal/x86.cgen_shift(0xaf0050, 0x133b6de0, 0x1b7f17a0, 0x1b7fe720)
        c:/go/src/cmd/compile/internal/x86/ggen.go:420 +0x613
cmd/compile/internal/gc.cgen_wb(0x133b6f00, 0x1b7fe720, 0x11cce600)
        c:/go/src/cmd/compile/internal/gc/cgen.go:683 +0x44ae
cmd/compile/internal/gc.Cgen(0x133b6f00, 0x1b7fe720)
        c:/go/src/cmd/compile/internal/gc/cgen.go:19 +0x2e
cmd/compile/internal/gc.Mgen(0x133b6f00, 0x1b7fe720, 0x1b7fe4e0)
        c:/go/src/cmd/compile/internal/gc/cgen.go:906 +0xd9
cmd/compile/internal/gc.cgen_wb(0x133b6fc0, 0x1b7fe4e0, 0x0)
        c:/go/src/cmd/compile/internal/gc/cgen.go:714 +0x2067
cmd/compile/internal/gc.Cgen(0x133b6fc0, 0x1b7fe4e0)
        c:/go/src/cmd/compile/internal/gc/cgen.go:19 +0x2e
cmd/compile/internal/gc.Mgen(0x133b6fc0, 0x1b7fe4e0, 0x1b7fe480)
        c:/go/src/cmd/compile/internal/gc/cgen.go:906 +0xd9
cmd/compile/internal/gc.cgen_wb(0x133b7020, 0x1b7fe480, 0x1b7fe400)
        c:/go/src/cmd/compile/internal/gc/cgen.go:460 +0x3318
cmd/compile/internal/gc.Cgen(0x133b7020, 0x1b7fe480)
        c:/go/src/cmd/compile/internal/gc/cgen.go:19 +0x2e
cmd/compile/internal/x86.cgen_shift(0xaf004f, 0x133b7020, 0x133b6ae0, 0x1b7fe240)
        c:/go/src/cmd/compile/internal/x86/ggen.go:420 +0x613
cmd/compile/internal/gc.cgen_wb(0x133b7080, 0x1b7fe240, 0x1b7fe200)
        c:/go/src/cmd/compile/internal/gc/cgen.go:683 +0x44ae
cmd/compile/internal/gc.Cgen(0x133b7080, 0x1b7fe240)
        c:/go/src/cmd/compile/internal/gc/cgen.go:19 +0x2e
cmd/compile/internal/gc.cgen_wb(0x1b7f08a0, 0x1b7fe120, 0x1b7fe100)
        c:/go/src/cmd/compile/internal/gc/cgen.go:725 +0x225c
cmd/compile/internal/gc.Cgen(0x1b7f08a0, 0x1b7fe120)
        c:/go/src/cmd/compile/internal/gc/cgen.go:19 +0x2e
cmd/compile/internal/gc.cgen_wb(0x1b7f08a0, 0x133b6c00, 0x1b6c2100)
        c:/go/src/cmd/compile/internal/gc/cgen.go:102 +0x5ad
cmd/compile/internal/gc.Cgen_as_wb(0x133b6c00, 0x1b7f08a0, 0x0)
        c:/go/src/cmd/compile/internal/gc/gen.go:1023 +0x138
cmd/compile/internal/gc.Cgen_as(0x133b6c00, 0x1b7f08a0)
        c:/go/src/cmd/compile/internal/gc/gen.go:979 +0x2e
cmd/compile/internal/gc.gen(0x133b70e0)
        c:/go/src/cmd/compile/internal/gc/gen.go:926 +0x1be
cmd/compile/internal/gc.Genlist(0x16b85690)
        c:/go/src/cmd/compile/internal/gc/gen.go:311 +0x6d
cmd/compile/internal/gc.gen(0x133b6300)
        c:/go/src/cmd/compile/internal/gc/gen.go:860 +0x977
cmd/compile/internal/gc.Genlist(0x16b856e0)
        c:/go/src/cmd/compile/internal/gc/gen.go:311 +0x6d
cmd/compile/internal/gc.gen(0x133b3e60)
        c:/go/src/cmd/compile/internal/gc/gen.go:860 +0x977
cmd/compile/internal/gc.Genlist(0x16b85780)
        c:/go/src/cmd/compile/internal/gc/gen.go:311 +0x6d
cmd/compile/internal/gc.genlegacy(0x1309a180, 0x1b7e6f40, 0x1b7e6fc0)
        c:/go/src/cmd/compile/internal/gc/pgen.go:498 +0x56
cmd/compile/internal/gc.compile(0x133b2420)
        c:/go/src/cmd/compile/internal/gc/pgen.go:485 +0xfcd
cmd/compile/internal/gc.funccompile(0x133b2420)
        c:/go/src/cmd/compile/internal/gc/dcl.go:1287 +0x167
cmd/compile/internal/gc.Main()
        c:/go/src/cmd/compile/internal/gc/main.go:467 +0x1bf4
cmd/compile/internal/x86.Main()
        c:/go/src/cmd/compile/internal/x86/galign.go:80 +0x2dc
main.main()
        c:/go/src/cmd/compile/main.go:31 +0x117

Because of this issue, I need to use go 1.4.3, for 386 builds.

bradfitz commented 8 years ago

It's fixed already in Go 1.8 with the SSA backend for 386.