]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile, cmd/compile/internal/x86: do not let regopt use CX in position independe...
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 27 Oct 2015 22:43:15 +0000 (11:43 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Wed, 18 Nov 2015 01:44:32 +0000 (01:44 +0000)
We might be able to do better than this, but it's a start.

Change-Id: I80ebce9094e084a4746039106ccf1ad9c4b8bb7c
Reviewed-on: https://go-review.googlesource.com/16384
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/x86/reg.go

index b3a5fdf4e054385ba21412b74efdd7265ae42d93..76d90b8e898f2d469b6abdc9d513320998d1d6ae 100644 (file)
@@ -62,7 +62,11 @@ func regnames(n *int) []string {
 }
 
 func excludedregs() uint64 {
-       return RtoB(x86.REG_SP)
+       if gc.Ctxt.Flag_shared != 0 {
+               return RtoB(x86.REG_SP) | RtoB(x86.REG_CX)
+       } else {
+               return RtoB(x86.REG_SP)
+       }
 }
 
 func doregbits(r int) uint64 {