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/mips/obj0.go | |
| 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/mips/obj0.go')
| -rw-r--r-- | src/cmd/internal/obj/mips/obj0.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/internal/obj/mips/obj0.go b/src/cmd/internal/obj/mips/obj0.go index ef242c5f3b..b9152fe57e 100644 --- a/src/cmd/internal/obj/mips/obj0.go +++ b/src/cmd/internal/obj/mips/obj0.go @@ -767,6 +767,12 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { p.To.Type = obj.TYPE_REG p.To.Reg = REG_R1 + // 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 @@ -870,6 +876,8 @@ func (c *ctxt0) stacksplit(p *obj.Prog, framesize int32) *obj.Prog { } p.Mark |= BRANCH + p = c.ctxt.EndUnsafePoint(p, c.newprog, -1) + // JMP start p = obj.Appendp(p, c.newprog) |
