diff options
author | Cherry Zhang <cherryyz@google.com> | 2021-04-04 12:20:35 -0400 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2021-04-05 17:25:15 +0000 |
commit | 45e87cd3ecfe5e579a06493ef8cd43ce9947262c (patch) | |
tree | 9af8496208e556d5d76c4c4e7e94068961bde1fa /src/cmd/compile/internal/reflectdata | |
parent | 411860251eb91b284efb901264a9c46d26b588e3 (diff) | |
download | go-45e87cd3ecfe5e579a06493ef8cd43ce9947262c.tar.gz go-45e87cd3ecfe5e579a06493ef8cd43ce9947262c.zip |
cmd/compile: disable tail call for method wrappers when RegabiArgs is enabled
Currently, the IR of tailcall does not connect the arguments with
the OTAILCALL node, so the arguments are not marshaled correctly.
Disable tail call for now.
Updates #40724.
Change-Id: I39de3ea8e19a23eb63768ab7282d2f870e9c266e
Reviewed-on: https://go-review.googlesource.com/c/go/+/307234
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/compile/internal/reflectdata')
-rw-r--r-- | src/cmd/compile/internal/reflectdata/reflect.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/reflectdata/reflect.go b/src/cmd/compile/internal/reflectdata/reflect.go index 3a31e3c951..379735e86b 100644 --- a/src/cmd/compile/internal/reflectdata/reflect.go +++ b/src/cmd/compile/internal/reflectdata/reflect.go @@ -1770,7 +1770,11 @@ func methodWrapper(rcvr *types.Type, method *types.Field) *obj.LSym { // the TOC to the appropriate value for that module. But if it returns // directly to the wrapper's caller, nothing will reset it to the correct // value for that function. - if !base.Flag.Cfg.Instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !types.IsInterfaceMethod(method.Type) && !(base.Ctxt.Arch.Name == "ppc64le" && base.Ctxt.Flag_dynlink) { + // + // Disable tailcall for RegabiArgs for now. The IR does not connect the + // arguments with the OTAILCALL node, and the arguments are not marshaled + // correctly. + if !base.Flag.Cfg.Instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !types.IsInterfaceMethod(method.Type) && !(base.Ctxt.Arch.Name == "ppc64le" && base.Ctxt.Flag_dynlink) && !objabi.Experiment.RegabiArgs { // generate tail call: adjust pointer receiver and jump to embedded method. left := dot.X // skip final .M if !left.Type().IsPtr() { |