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

cmd/compile: guard partially live arg spilling with number of registers

The code that does partially live in-register arg spilling is
currently guarded with GOEXPERIMENT=regabiargs. But on platforms
where GOEXPERIMENT=regabiargs is not enabled there are still tests
that use register args. Guard it with actual number of registers
used, so it covers both.

Should fix the freeBSD builder.

Change-Id: I0d3c49d7a2389096cb6b17ca35b9b4ce567bc91e
Reviewed-on: https://go-review.googlesource.com/c/go/+/311830
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Zhang 2021-04-20 13:09:54 -04:00
parent 109d7580a5
commit 77860ad280

View File

@ -6898,7 +6898,7 @@ func defframe(s *State, e *ssafn, f *ssa.Func) {
// and not address-taken (for non-SSA-able or address-taken arguments we always
// spill upfront).
// TODO(register args) Make liveness more fine-grained to that partial spilling is okay.
if buildcfg.Experiment.RegabiArgs {
if f.OwnAux.ABIInfo().InRegistersUsed() != 0 {
// First, see if it is already spilled before it may be live. Look for a spill
// in the entry block up to the first safepoint.
type nameOff struct {