From 77860ad2809d88566d28783e0382073fb9836d9b Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Tue, 20 Apr 2021 13:09:54 -0400 Subject: [PATCH] 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 Run-TryBot: Cherry Zhang TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- src/cmd/compile/internal/ssagen/ssa.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/ssagen/ssa.go b/src/cmd/compile/internal/ssagen/ssa.go index e7d4865375..c5b1ae2e4a 100644 --- a/src/cmd/compile/internal/ssagen/ssa.go +++ b/src/cmd/compile/internal/ssagen/ssa.go @@ -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 { -- 2.50.0