]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't clobber LR for tail calls
authorCherry Mui <cherryyz@google.com>
Mon, 25 Oct 2021 15:51:25 +0000 (11:51 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 25 Oct 2021 17:46:41 +0000 (17:46 +0000)
commit9012996a9a127fd566c72baac5e7d8ba45b4865e
tree0d81ad597abd2bf92874f9321f0aad7fa9df03ac
parent95372efc4d300c54738406fb81d84a72bd8149cc
cmd/compile: don't clobber LR for tail calls

When doing a tail call the link register is live as the callee
will directly return to the caller (of the function that does the
tail call). Don't allocate or clobber the link register.

Fixes #49032.

Change-Id: I2d60f2354e5b6c14aa285c8983a9786687b90223
Reviewed-on: https://go-review.googlesource.com/c/go/+/358435
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
14 files changed:
src/cmd/compile/internal/ssa/gen/386Ops.go
src/cmd/compile/internal/ssa/gen/AMD64Ops.go
src/cmd/compile/internal/ssa/gen/ARM64Ops.go
src/cmd/compile/internal/ssa/gen/ARMOps.go
src/cmd/compile/internal/ssa/gen/MIPS64Ops.go
src/cmd/compile/internal/ssa/gen/MIPSOps.go
src/cmd/compile/internal/ssa/gen/PPC64Ops.go
src/cmd/compile/internal/ssa/gen/RISCV64Ops.go
src/cmd/compile/internal/ssa/gen/S390XOps.go
src/cmd/compile/internal/ssa/gen/WasmOps.go
src/cmd/compile/internal/ssa/gen/main.go
src/cmd/compile/internal/ssa/op.go
src/cmd/compile/internal/ssa/opGen.go
src/cmd/compile/internal/ssa/regalloc.go