golang / go

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

internal compiler error: out of fixed registers #17396

Closed hankgao closed 8 years ago

hankgao commented 8 years ago

Please answer these questions before submitting your issue. Thanks!

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

go version go1.7.1 darwin/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/hankgao/Goworkspace" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/p8/vf5_02s55657lmlk3l86d1rc0000gp/T/go-build276928231=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1"

What did you do?

If possible, provide a recipe for reproducing the error. A complete runnable program is good. A link on play.golang.org is best.

I ran this command: gomobile bind -target=android github.com/skycoin/skycoin-exchange/src/api/mobile

What did you expect to see

aar file is created successfully

What did you see instead?

bind stopped, the following message is displayed:

gomobile: go install -pkgdir=/Users/hankgao/Goworkspace/pkg/gomobile/pkg_android_386 -tags="" -gcflags=-shared -ldflags=-shared github.com/skycoin/skycoin-exchange/src/api/mobile failed: exit status 2

github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2

run compiler with -v for register allocation sites Goworkspace/src/github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2/field.go:49: internal compiler error: out of fixed registers

goroutine 1 [running]: runtime/debug.Stack(0x0, 0x0, 0x0) /usr/local/go/src/runtime/debug/stack.go:24 +0x79 cmd/compile/internal/gc.Fatalf(0x4ffa79, 0x16, 0x0, 0x0, 0x0) /usr/local/go/src/cmd/compile/internal/gc/subr.go:165 +0x248 cmd/compile/internal/gc.Regalloc(0xc42e198a20, 0xc42001caf0, 0xc42e198900) /usr/local/go/src/cmd/compile/internal/gc/gsubr.go:749 +0x16b cmd/compile/internal/x86.ginscmp(0xc42062733e, 0xc42001caf0, 0xc42e1987e0, 0xc42e198900, 0x1, 0x263644) /usr/local/go/src/cmd/compile/internal/x86/gsubr.go:657 +0x364 cmd/compile/internal/gc.Agenr(0xc42062d290, 0xc42e197d40, 0xc42e197cb0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:1245 +0x20e8 cmd/compile/internal/gc.Igen(0xc42062d290, 0xc42e197d40, 0xc42e197cb0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:1718 +0x279 cmd/compile/internal/gc.cgen_wb(0xc42062d290, 0xc42e197cb0, 0x0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:523 +0x2281 cmd/compile/internal/gc.Cgen(0xc42062d290, 0xc42e197cb0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:19 +0x3a cmd/compile/internal/x86.cgen_shift(0x700050, 0xc42062d290, 0xc42e18b680, 0xc42e1977a0) /usr/local/go/src/cmd/compile/internal/x86/ggen.go:420 +0x52a cmd/compile/internal/gc.cgen_wb(0xc42062d440, 0xc42e1977a0, 0xc4205f5000) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:683 +0x2af1 cmd/compile/internal/gc.Cgen(0xc42062d440, 0xc42e1977a0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:19 +0x3a cmd/compile/internal/gc.Mgen(0xc42062d440, 0xc42e1977a0, 0xc42e197440) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:906 +0xf7 cmd/compile/internal/gc.cgen_wb(0xc42062d560, 0xc42e197440, 0xc4205f5000) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:714 +0x11a6 cmd/compile/internal/gc.Cgen(0xc42062d560, 0xc42e197440) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:19 +0x3a cmd/compile/internal/gc.Mgen(0xc42062d560, 0xc42e197440, 0xc42e1973b0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:906 +0xf7 cmd/compile/internal/gc.cgen_wb(0xc42062d5f0, 0xc42e1973b0, 0x0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:460 +0x1c95 cmd/compile/internal/gc.Cgen(0xc42062d5f0, 0xc42e1973b0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:19 +0x3a cmd/compile/internal/x86.cgen_shift(0x70004f, 0xc42062d5f0, 0xc42062ce10, 0xc42e197050) /usr/local/go/src/cmd/compile/internal/x86/ggen.go:420 +0x52a cmd/compile/internal/gc.cgen_wb(0xc42062d680, 0xc42e197050, 0xc4205f5000) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:683 +0x2af1 cmd/compile/internal/gc.Cgen(0xc42062d680, 0xc42e197050) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:19 +0x3a cmd/compile/internal/gc.cgen_wb(0xc42e18a000, 0xc42e196ea0, 0x0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:725 +0xe4c cmd/compile/internal/gc.Cgen(0xc42e18a000, 0xc42e196ea0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:19 +0x3a cmd/compile/internal/gc.cgen_wb(0xc42e18a000, 0xc42062cfc0, 0x0) /usr/local/go/src/cmd/compile/internal/gc/cgen.go:102 +0x427d cmd/compile/internal/gc.Cgen_as_wb(0xc42062cfc0, 0xc42e18a000, 0x17600000800) /usr/local/go/src/cmd/compile/internal/gc/gen.go:1023 +0x17b cmd/compile/internal/gc.Cgen_as(0xc42062cfc0, 0xc42e18a000) /usr/local/go/src/cmd/compile/internal/gc/gen.go:979 +0x3a cmd/compile/internal/gc.gen(0xc42062d710) /usr/local/go/src/cmd/compile/internal/gc/gen.go:926 +0xd6c cmd/compile/internal/gc.Genlist(0xc426530ce0) /usr/local/go/src/cmd/compile/internal/gc/gen.go:311 +0x50 cmd/compile/internal/gc.gen(0xc42062c240) /usr/local/go/src/cmd/compile/internal/gc/gen.go:860 +0x62f cmd/compile/internal/gc.Genlist(0xc426530d60) /usr/local/go/src/cmd/compile/internal/gc/gen.go:311 +0x50 cmd/compile/internal/gc.gen(0xc420629b00) /usr/local/go/src/cmd/compile/internal/gc/gen.go:860 +0x62f cmd/compile/internal/gc.Genlist(0xc426530dc0) /usr/local/go/src/cmd/compile/internal/gc/gen.go:311 +0x50 cmd/compile/internal/gc.genlegacy(0xc4200e8278, 0xc4207245b0, 0xc420724620) /usr/local/go/src/cmd/compile/internal/gc/pgen.go:498 +0x4d cmd/compile/internal/gc.compile(0xc420627560) /usr/local/go/src/cmd/compile/internal/gc/pgen.go:485 +0x7a4 cmd/compile/internal/gc.funccompile(0xc420627560) /usr/local/go/src/cmd/compile/internal/gc/dcl.go:1287 +0x186 cmd/compile/internal/gc.Main() /usr/local/go/src/cmd/compile/internal/gc/main.go:467 +0x19f8 cmd/compile/internal/x86.Main() /usr/local/go/src/cmd/compile/internal/x86/galign.go:80 +0x3ba main.main() /usr/local/go/src/cmd/compile/main.go:31 +0x1d4

bradfitz commented 8 years ago

You're using GOARCH=386. This is fixed with the new SSA backend at tip, since SSA is now for all architectures, not just amd64.

hankgao commented 8 years ago

thanks for the quick response