diff options
| author | Keith Randall <khr@golang.org> | 2025-05-05 10:51:52 -0700 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-05-05 13:08:27 -0700 |
| commit | fa2bb342d7b0024440d996c2d6d6778b7a5e0247 (patch) | |
| tree | c64fe4b39f32fbca02ee89e22f54fb9e991a828c /src/cmd/internal/obj/ppc64 | |
| parent | 6729fbe93e535080e9e050b3ca0a80ab407dbacc (diff) | |
| download | go-fa2bb342d7b0024440d996c2d6d6778b7a5e0247.tar.xz | |
Revert "cmd/compile: allow all of the preamble to be preemptible"
This reverts commits
3f3782feed6e0726ddb08afd32dad7d94fbb38c6 (CL 648518)
b386b628521780c048af14a148f373c84e687b26 (CL 668475)
Fixes #73542
Change-Id: I218851c5c0b62700281feb0b3f82b6b9b97b910d
Reviewed-on: https://go-review.googlesource.com/c/go/+/670055
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/internal/obj/ppc64')
| -rw-r--r-- | src/cmd/internal/obj/ppc64/obj9.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 77f13fadf9..2d2c198ab9 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -1364,6 +1364,12 @@ func (c *ctxt9) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p.To.Type = obj.TYPE_REG p.To.Reg = REG_R22 + // Mark the stack bound check and morestack call async nonpreemptible. + // If we get preempted here, when resumed the preemption request is + // cleared, but we'll still call morestack, which will double the stack + // unnecessarily. See issue #35470. + p = c.ctxt.StartUnsafePoint(p, c.newprog) + var q *obj.Prog if framesize <= abi.StackSmall { // small stack: SP < stackguard @@ -1550,6 +1556,8 @@ func (c *ctxt9) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p.To.Reg = REG_R2 } + // The instructions which unspill regs should be preemptible. + p = c.ctxt.EndUnsafePoint(p, c.newprog, -1) unspill := c.cursym.Func().UnspillRegisterArgs(p, c.newprog) // BR start |
