From: Cherry Zhang Date: Tue, 20 Apr 2021 17:09:54 +0000 (-0400) Subject: cmd/compile: guard partially live arg spilling with number of registers X-Git-Tag: go1.17beta1~551 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=77860ad280;p=gostls13.git 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 --- 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 {