aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2016-09-29 11:38:47 -0700
committerMatthew Dempsky <mdempsky@google.com>2016-09-29 18:54:16 +0000
commitf5516559e65175887f2fadb73cd8e5fdfc44bcd6 (patch)
tree221d6442e69e4b072b1fb438df2616d4dbdcf348 /src
parent2b49d129c48b0036ee595fbf7b91a0e9292f87ee (diff)
downloadgo-f5516559e65175887f2fadb73cd8e5fdfc44bcd6.tar.xz
cmd/compile/internal/x86: fix zero-range merging logic
All other architectures merge stack-zeroing ranges if there are at most two pointers/registers of memory between them, but x86 is erroneously coded to require *exactly* two. Shaves a tiny amount of text size off cmd/go when building for GOARCH=386 and eliminates an unnecessary inconsistency between x86's defframe and the other GOARCHes'. text data bss dec hex filename 5241015 191051 93336 5525402 544f9a go.before 5240224 191051 93336 5524611 544c83 go.after Change-Id: Ib15ec8c07bca11e824640f0ab32abfc4bb160496 Reviewed-on: https://go-review.googlesource.com/30050 Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/x86/ggen.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/x86/ggen.go b/src/cmd/compile/internal/x86/ggen.go
index d146fb1b54..25769b4de0 100644
--- a/src/cmd/compile/internal/x86/ggen.go
+++ b/src/cmd/compile/internal/x86/ggen.go
@@ -36,7 +36,7 @@ func defframe(ptxt *obj.Prog) {
if n.Type.Width%int64(gc.Widthptr) != 0 || n.Xoffset%int64(gc.Widthptr) != 0 || n.Type.Width == 0 {
gc.Fatalf("var %L has size %d offset %d", n, int(n.Type.Width), int(n.Xoffset))
}
- if lo != hi && n.Xoffset+n.Type.Width == lo-int64(2*gc.Widthptr) {
+ if lo != hi && n.Xoffset+n.Type.Width >= lo-int64(2*gc.Widthptr) {
// merge with range we already have
lo = n.Xoffset