aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/arm/obj5.go
diff options
context:
space:
mode:
authorMichael Munday <munday@ca.ibm.com>2017-03-28 15:10:20 -0400
committerMichael Munday <munday@ca.ibm.com>2017-03-29 20:35:46 +0000
commit41fd8d6401b6702b801678a493001ec9e08d6f2d (patch)
tree0d1c3b54af049135a376fbc5523ca14a3ea37891 /src/cmd/internal/obj/arm/obj5.go
parentfbe6723903cc7ec06d0158d4909c6cb15c1ff977 (diff)
downloadgo-41fd8d6401b6702b801678a493001ec9e08d6f2d.tar.xz
cmd/internal/obj: make morestack cutoff the same on all architectures
There is always 128 bytes available below the stackguard. Allow functions with medium-sized stack frames to use this, potentially allowing them to avoid growing the stack. This change makes all architectures use the same calculation as x86. Change-Id: I2afb1a7c686ae5a933e50903b31ea4106e4cd0a0 Reviewed-on: https://go-review.googlesource.com/38734 Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/internal/obj/arm/obj5.go')
-rw-r--r--src/cmd/internal/obj/arm/obj5.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/internal/obj/arm/obj5.go b/src/cmd/internal/obj/arm/obj5.go
index 0d798e4400..630a59cc66 100644
--- a/src/cmd/internal/obj/arm/obj5.go
+++ b/src/cmd/internal/obj/arm/obj5.go
@@ -747,14 +747,14 @@ func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog {
p.Reg = REGSP
} else if framesize <= obj.StackBig {
// large stack: SP-framesize < stackguard-StackSmall
- // MOVW $-framesize(SP), R2
+ // MOVW $-(framesize-StackSmall)(SP), R2
// CMP stackguard, R2
p = obj.Appendp(ctxt, p)
p.As = AMOVW
p.From.Type = obj.TYPE_ADDR
p.From.Reg = REGSP
- p.From.Offset = int64(-framesize)
+ p.From.Offset = -(int64(framesize) - obj.StackSmall)
p.To.Type = obj.TYPE_REG
p.To.Reg = REG_R2