diff options
| author | Michael Munday <munday@ca.ibm.com> | 2017-03-28 15:10:20 -0400 |
|---|---|---|
| committer | Michael Munday <munday@ca.ibm.com> | 2017-03-29 20:35:46 +0000 |
| commit | 41fd8d6401b6702b801678a493001ec9e08d6f2d (patch) | |
| tree | 0d1c3b54af049135a376fbc5523ca14a3ea37891 /src/cmd/internal/obj/ppc64/obj9.go | |
| parent | fbe6723903cc7ec06d0158d4909c6cb15c1ff977 (diff) | |
| download | go-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/ppc64/obj9.go')
| -rw-r--r-- | src/cmd/internal/obj/ppc64/obj9.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/internal/obj/ppc64/obj9.go b/src/cmd/internal/obj/ppc64/obj9.go index 5639ec989d..9a3dc4cc72 100644 --- a/src/cmd/internal/obj/ppc64/obj9.go +++ b/src/cmd/internal/obj/ppc64/obj9.go @@ -868,13 +868,13 @@ func stacksplit(ctxt *obj.Link, p *obj.Prog, framesize int32) *obj.Prog { p.To.Reg = REGSP } else if framesize <= obj.StackBig { // large stack: SP-framesize < stackguard-StackSmall - // ADD $-framesize, SP, R4 + // ADD $-(framesize-StackSmall), SP, R4 // CMP stackguard, R4 p = obj.Appendp(ctxt, p) p.As = AADD p.From.Type = obj.TYPE_CONST - p.From.Offset = int64(-framesize) + p.From.Offset = -(int64(framesize) - obj.StackSmall) p.Reg = REGSP p.To.Type = obj.TYPE_REG p.To.Reg = REG_R4 |
