1
0
mirror of https://github.com/golang/go synced 2024-11-18 04:14:49 -07:00

cmd/compile/internal/arm64: remove Reginuse check in clearfat

Fixes golang/go#12133

CL 13630 fixed the use of a stale reg[] array in the various arch
backends which was causing the check in clearfat to pass
unconditionally on arm64.

With this check fixed, arm64 now considers REGRT1 to always be in use
as it is part of the reserved register set, see arm64/gsubr.go.

However, ppc64 does not consider REGRT1 and REGRT2 to be part of its
reserved set, so its identical clearfat check passes.

This CL removes the Reginuse check inside clearfat as REGRT1 is
guarenteed always be free on arm64.

Change-Id: I4719150d3c3378fae155b863c474529df18d4c17
Reviewed-on: https://go-review.googlesource.com/13650
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Dave Cheney 2015-08-15 15:25:46 +10:00
parent e8c4a5b893
commit 467a2cb73c

View File

@ -418,15 +418,12 @@ func clearfat(nl *gc.Node) {
c := uint64(w % 8) // bytes
q := uint64(w / 8) // dwords
if gc.GetReg(arm64.REGRT1) > 0 {
gc.Fatal("R%d in use during clearfat", arm64.REGRT1-arm64.REG_R0)
}
var r0 gc.Node
gc.Nodreg(&r0, gc.Types[gc.TUINT64], arm64.REGZERO)
var dst gc.Node
// REGRT1 is reserved on arm64, see arm64/gsubr.go.
gc.Nodreg(&dst, gc.Types[gc.Tptr], arm64.REGRT1)
gc.SetReg(arm64.REGRT1, gc.GetReg(arm64.REGRT1)+1)
gc.Agen(nl, &dst)
var boff uint64
@ -484,8 +481,6 @@ func clearfat(nl *gc.Node) {
p.To.Type = obj.TYPE_MEM
p.To.Offset = int64(t + boff)
}
gc.SetReg(arm64.REGRT1, gc.GetReg(arm64.REGRT1)-1)
}
// Called after regopt and peep have run.