]> Cypherpunks repositories - gostls13.git/commitdiff
LEAQ bug
authorKen Thompson <ken@golang.org>
Sun, 21 Dec 2008 00:05:12 +0000 (16:05 -0800)
committerKen Thompson <ken@golang.org>
Sun, 21 Dec 2008 00:05:12 +0000 (16:05 -0800)
R=r
OCL=21684
CL=21684

src/cmd/6g/gen.c

index 0f625c649b17be735fd8ca1b1b9645c3c30ace98..640243f7f5c1944ffe723e17b526eabacc535ec2 100644 (file)
@@ -880,7 +880,7 @@ cgen_callret(Node *n, Node *res)
 void
 cgen_aret(Node *n, Node *res)
 {
-       Node nod1;
+       Node nod1, nod2;
        Type *fp, *t;
        Iter flist;
 
@@ -900,7 +900,13 @@ cgen_aret(Node *n, Node *res)
        nod1.xoffset = fp->width;
        nod1.type = fp->type;
 
-       gins(ALEAQ, &nod1, res);
+       if(res->op != OREGISTER) {
+print("its 1\n");
+               regalloc(&nod2, types[tptr], res);
+               gins(ALEAQ, &nod1, &nod2);
+               gins(AMOVQ, &nod2, res);
+       } else
+               gins(ALEAQ, &nod1, res);
 }
 
 void