aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/gen
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2021-04-01 11:11:04 -0400
committerCherry Zhang <cherryyz@google.com>2021-04-02 16:31:47 +0000
commit6996bae5d1d34ea9e2ab6399f70adb402697ed94 (patch)
treecdeba8e084f91feb0fd11527f45ea9a9e09d15e8 /src/cmd/compile/internal/ssa/gen
parent759116b3ace07f431103d65a7ce6cf4f314203bf (diff)
downloadgo-6996bae5d1d34ea9e2ab6399f70adb402697ed94.tar.gz
go-6996bae5d1d34ea9e2ab6399f70adb402697ed94.zip
cmd/compile: use ABI0 for cgo_unsafe_args functions
cgo_unsafe_args paragma indicates that the function (or its callee) uses address and offsets to dispatch arguments, which currently using ABI0 frame layout. Pin them to ABI0. With this, "GOEXPERIMENT=regabi,regabiargs go run hello.go" works on Darwin/AMD64. Change-Id: I3eadd5a3646a9de8fa681fa0a7f46e7cdc217d24 Reviewed-on: https://go-review.googlesource.com/c/go/+/306609 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/gen')
-rw-r--r--src/cmd/compile/internal/ssa/gen/AMD64.rules2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ssa/gen/AMD64.rules b/src/cmd/compile/internal/ssa/gen/AMD64.rules
index 98cd865182..839d4a330e 100644
--- a/src/cmd/compile/internal/ssa/gen/AMD64.rules
+++ b/src/cmd/compile/internal/ssa/gen/AMD64.rules
@@ -460,7 +460,7 @@
(IsInBounds idx len) => (SETB (CMPQ idx len))
(IsSliceInBounds idx len) => (SETBE (CMPQ idx len))
(NilCheck ...) => (LoweredNilCheck ...)
-(GetG mem) && !objabi.Experiment.RegabiG => (LoweredGetG mem) // only lower in old ABI. in new ABI we have a G register.
+(GetG mem) && !(objabi.Experiment.RegabiG && v.Block.Func.OwnAux.Fn.ABI() == obj.ABIInternal) => (LoweredGetG mem) // only lower in old ABI. in new ABI we have a G register.
(GetClosurePtr ...) => (LoweredGetClosurePtr ...)
(GetCallerPC ...) => (LoweredGetCallerPC ...)
(GetCallerSP ...) => (LoweredGetCallerSP ...)