summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorR?my Oudompheng <oudomphe@phare.normalesup.org>2014-04-09 21:23:36 +0200
committerR?my Oudompheng <oudomphe@phare.normalesup.org>2014-04-09 21:23:36 +0200
commit4ea625675139f80c69cffb40f4b55487a87f1a00 (patch)
tree09e934171e35c86db5e2b4b748c387b95e9da920 /src
parent702c2c55c71768fc6287e3459cc7fc2cb6efe68b (diff)
downloadgo-4ea625675139f80c69cffb40f4b55487a87f1a00.tar.gz
cmd/6g: relax constraint on variables that need zeroing.
On amd64p32 pointers are 32-bit-aligned and cannot be assumed to have an offset multiple of widthreg. Instead check that they are withptr-aligned. Also change the threshold for region merging to 2*widthreg instead of 2*widthptr because performance on amd64 and amd64p32 is expected to be the same. Fixes issue 7712. LGTM=khr R=rsc, dave, khr, brad, bradfitz CC=golang-codereviews https://codereview.appspot.com/84690044
Diffstat (limited to 'src')
-rw-r--r--src/cmd/6g/ggen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/6g/ggen.c b/src/cmd/6g/ggen.c
index 2633b19e4..991783bc5 100644
--- a/src/cmd/6g/ggen.c
+++ b/src/cmd/6g/ggen.c
@@ -42,12 +42,12 @@ defframe(Prog *ptxt)
continue;
if(n->class != PAUTO)
fatal("needzero class %d", n->class);
- if(n->type->width % widthreg != 0 || n->xoffset % widthreg != 0 || n->type->width == 0)
+ if(n->type->width % widthptr != 0 || n->xoffset % widthptr != 0 || n->type->width == 0)
fatal("var %lN has size %d offset %d", n, (int)n->type->width, (int)n->xoffset);
- if(lo != hi && n->xoffset + n->type->width >= lo - 2*widthptr) {
+ if(lo != hi && n->xoffset + n->type->width >= lo - 2*widthreg) {
// merge with range we already have
- lo = n->xoffset;
+ lo = rnd(n->xoffset, widthreg);
continue;
}
// zero old range