Skip to content

Commit 2ebe77a

Browse files
committed
cmd/internal/obj: use REGENTRYTMP* in a few more places
There are a few remaining places in obj6 where we hard-code safe-on-entry registers. Fix those to use the consts. For #40724. Change-Id: Ie640521aa67d6c99bc057553dc122160049c6edc Reviewed-on: https://go-review.googlesource.com/c/go/+/307009 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
1 parent f25d78f commit 2ebe77a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cmd/internal/obj/x86/obj6.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
10461046
tmp := int16(REG_AX) // use AX for 32-bit
10471047
if ctxt.Arch.Family == sys.AMD64 {
10481048
// for 64-bit, stay away from register ABI parameter registers, even w/o GOEXPERIMENT=regabi
1049-
tmp = int16(REG_R13)
1049+
tmp = int16(REGENTRYTMP0)
10501050
}
10511051
// large stack: SP-framesize <= stackguard-StackSmall
10521052
// LEAQ -xxx(SP), tmp
@@ -1076,8 +1076,8 @@ func stacksplit(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog, newprog obj.ProgA
10761076
tmp1 := int16(REG_SI)
10771077
tmp2 := int16(REG_AX)
10781078
if ctxt.Arch.Family == sys.AMD64 {
1079-
tmp1 = int16(REG_R13) // register ABI uses REG_SI and REG_AX for parameters.
1080-
tmp2 = int16(REG_R12)
1079+
tmp1 = int16(REGENTRYTMP0) // register ABI uses REG_SI and REG_AX for parameters.
1080+
tmp2 = int16(REGENTRYTMP1)
10811081
}
10821082
// Such a large stack we need to protect against wraparound.
10831083
// If SP is close to zero:

0 commit comments

Comments
 (0)