components/golang/patches/0038-release-branch.go1.5-cmd-compile-do-not-let-regopt-u.patch
changeset 5331 9c955076ffe3
equal deleted inserted replaced
5330:c36e3195e3e9 5331:9c955076ffe3
       
     1 From 8b3f554d869e1d6e7a0bd1574135402cfc6dc1a3 Mon Sep 17 00:00:00 2001
       
     2 From: Michael Hudson-Doyle <[email protected]>
       
     3 Date: Mon, 5 Oct 2015 16:07:59 +1300
       
     4 Subject: [PATCH 38/63] [release-branch.go1.5] cmd/compile: do not let regopt
       
     5  use REGTMP on ppc64
       
     6 
       
     7 ppc64 codegen assumes that it is OK to stomp on r31 at any time, but it is not
       
     8 excluded from the set of registers that regopt is allowed to use.
       
     9 
       
    10 Fixes #12597
       
    11 
       
    12 Change-Id: I29c7655e32abd22f3c21d88427b73e4fca055233
       
    13 Reviewed-on: https://go-review.googlesource.com/15245
       
    14 Reviewed-by: Minux Ma <[email protected]>
       
    15 Reviewed-on: https://go-review.googlesource.com/16981
       
    16 Run-TryBot: Austin Clements <[email protected]>
       
    17 Reviewed-by: Ian Lance Taylor <[email protected]>
       
    18 Reviewed-by: Russ Cox <[email protected]>
       
    19 ---
       
    20  src/cmd/compile/internal/ppc64/reg.go | 2 +-
       
    21  1 file changed, 1 insertion(+), 1 deletion(-)
       
    22 
       
    23 diff --git a/src/cmd/compile/internal/ppc64/reg.go b/src/cmd/compile/internal/ppc64/reg.go
       
    24 index fa1cb71..a301836 100644
       
    25 --- a/src/cmd/compile/internal/ppc64/reg.go
       
    26 +++ b/src/cmd/compile/internal/ppc64/reg.go
       
    27 @@ -111,7 +111,7 @@ func regnames(n *int) []string {
       
    28  
       
    29  func excludedregs() uint64 {
       
    30  	// Exclude registers with fixed functions
       
    31 -	regbits := uint64(1<<0 | RtoB(ppc64.REGSP) | RtoB(ppc64.REGG) | RtoB(ppc64.REGTLS))
       
    32 +	regbits := uint64(1<<0 | RtoB(ppc64.REGSP) | RtoB(ppc64.REGG) | RtoB(ppc64.REGTLS) | RtoB(ppc64.REGTMP))
       
    33  
       
    34  	// Also exclude floating point registers with fixed constants
       
    35  	regbits |= RtoB(ppc64.REG_F27) | RtoB(ppc64.REG_F28) | RtoB(ppc64.REG_F29) | RtoB(ppc64.REG_F30) | RtoB(ppc64.REG_F31)
       
    36 -- 
       
    37 2.6.1
       
    38