1
0
mirror of https://github.com/golang/go synced 2024-11-17 22:14:43 -07:00

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 <iant@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2015-10-28 11:43:15 +13:00
parent 6056cc5df6
commit 61da0e92d0

View 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 {