]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: do not let regopt use REGTMP on ppc64
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 5 Oct 2015 03:07:59 +0000 (16:07 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 5 Oct 2015 03:50:51 +0000 (03:50 +0000)
ppc64 codegen assumes that it is OK to stomp on r31 at any time, but it is not
excluded from the set of registers that regopt is allowed to use.

Fixes #12597

Change-Id: I29c7655e32abd22f3c21d88427b73e4fca055233
Reviewed-on: https://go-review.googlesource.com/15245
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/compile/internal/ppc64/reg.go

index fa1cb71975e511316b44887eb471989503690f6c..a3018362f64019790ae3a92d0e1620b5b8b14ba1 100644 (file)
@@ -111,7 +111,7 @@ func regnames(n *int) []string {
 
 func excludedregs() uint64 {
        // Exclude registers with fixed functions
-       regbits := uint64(1<<0 | RtoB(ppc64.REGSP) | RtoB(ppc64.REGG) | RtoB(ppc64.REGTLS))
+       regbits := uint64(1<<0 | RtoB(ppc64.REGSP) | RtoB(ppc64.REGG) | RtoB(ppc64.REGTLS) | RtoB(ppc64.REGTMP))
 
        // Also exclude floating point registers with fixed constants
        regbits |= RtoB(ppc64.REG_F27) | RtoB(ppc64.REG_F28) | RtoB(ppc64.REG_F29) | RtoB(ppc64.REG_F30) | RtoB(ppc64.REG_F31)