]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: guard partially live arg spilling with number of registers
authorCherry Zhang <cherryyz@google.com>
Tue, 20 Apr 2021 17:09:54 +0000 (13:09 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 20 Apr 2021 18:34:56 +0000 (18:34 +0000)
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>
src/cmd/compile/internal/ssagen/ssa.go

index e7d486537579535684ed8a83afbc35a55ab1a88f..c5b1ae2e4a801087d4cc66c60fba85cb1e7217b1 100644 (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 {