]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/gc: Don't zero more than we need.
authorKeith Randall <khr@golang.org>
Wed, 2 Apr 2014 16:17:42 +0000 (09:17 -0700)
committerKeith Randall <khr@golang.org>
Wed, 2 Apr 2014 16:17:42 +0000 (09:17 -0700)
Don't merge with the zero range, we may
end up zeroing more than we need.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/83430044

src/cmd/6g/ggen.c
src/cmd/8g/ggen.c

index 51319f23dbfecac1875de697bef836f724bd0e7a..b980a78c258722c04e9690e4923ec2f40915bcb4 100644 (file)
@@ -45,7 +45,7 @@ defframe(Prog *ptxt)
                if(n->type->width % widthreg != 0 || n->xoffset % widthreg != 0 || n->type->width == 0)
                        fatal("var %lN has size %d offset %d", n, (int)n->type->width, (int)n->xoffset);
 
-               if(n->xoffset + n->type->width >= lo - 2*widthptr) {
+               if(lo != hi && n->xoffset + n->type->width >= lo - 2*widthptr) {
                        // merge with range we already have
                        lo = n->xoffset;
                        continue;
index 0a1523871e7029af74d3ab502452456d68e56ecd..35494f795b475bc5592b8a3ab11bacf8f98be09a 100644 (file)
@@ -42,7 +42,7 @@ defframe(Prog *ptxt)
                        fatal("needzero class %d", n->class);
                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(n->xoffset + n->type->width == lo - 2*widthptr) {
+               if(lo != hi && n->xoffset + n->type->width == lo - 2*widthptr) {
                        // merge with range we already have
                        lo = n->xoffset;
                        continue;