Commit 467a2cb7 authored by Dave Cheney's avatar Dave Cheney

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/13650Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent e8c4a5b8
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment