From: Michael Hudson-Doyle Date: Tue, 27 Oct 2015 22:43:15 +0000 (+1300) Subject: cmd/compile, cmd/compile/internal/x86: do not let regopt use CX in position independe... X-Git-Tag: go1.6beta1~404 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=61da0e92d06137dec73c736ab93213ac652a06fe;p=gostls13.git cmd/compile, cmd/compile/internal/x86: do not let regopt use CX in position independent code 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 --- diff --git a/src/cmd/compile/internal/x86/reg.go b/src/cmd/compile/internal/x86/reg.go index b3a5fdf4e0..76d90b8e89 100644 --- a/src/cmd/compile/internal/x86/reg.go +++ b/src/cmd/compile/internal/x86/reg.go @@ -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 {