Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: out of fixed registers (nested array/slice indexing) on amd64 #8355

Closed
remyoudompheng opened this issue Jul 11, 2014 · 4 comments

Comments

@remyoudompheng
Copy link
Contributor

1. What is a short input program that triggers the error?

http://play.golang.org/p/m59dvc6cXo

Also a reduced example:

package main

type T struct {
    F int
}

func f() {
    var (
        A = [][1]int{}
        B = []int{3: 1, 4: 1}
        X [2]byte
        Y [2]int
        Z []float64
        n int

        S     []T
        Funcs = [0]func() uintptr{}
    )

    var Var813 = Funcs[int(B[Y[S[A[X[int(Z[n])]-1][n]+1].F+1]])]()

        _ = Var813
}

2. What is the full compiler output?

0 0
1 0
2 0
3 40cee6
4 0
5 40a25c
6 0
7 0
8 40a25c
9 412470
10 40a25c
11 40a25c
12 40a25c
13 40999d
14 40ab97
15 40a2f5
bug1.go:20: internal compiler error: out of fixed registers


3. What version of the compiler are you using?  (Run it with the -V flag.)

go version devel +0a0e0c40901d Tue Jul 08 14:47:52 2014 -0400 linux/amd64
@gopherbot
Copy link

Comment 1:

CL https://golang.org/cl/113750043 mentions this issue.

@rsc
Copy link
Contributor

rsc commented Sep 15, 2014

Comment 2:

Labels changed: added release-none, removed release-go1.4.

@rsc rsc removed the arch-x86-64 label Apr 10, 2015
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title cmd/6g: out of fixed registers (nested array/slice indexing) cmd/compile: out of fixed registers (nested array/slice indexing) on amd64 Jun 8, 2015
@griesemer
Copy link
Contributor

From #10088: Make sure this code works as well:

package main
func main() {
    type X struct {
        f int
    }
    var x X
    var xx []X
    var s0 []int
    var s1 []func()
    var s2 [][][]int
    var s3 [][]int
    var s4 [][]int16
    s1[xx[int(s4[0][s0[s3[s0[s2[s3[s0[s0[s0[x.f]]-1]+1][0]-1][0][0]]-1][0]]+1])].f-1]() 
}

@randall77
Copy link
Contributor

Fixed with new SSA backend.

@golang golang locked and limited conversation to collaborators Oct 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants