]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] liblink: emit wrapper code in correct place
authorAustin Clements <austin@google.com>
Tue, 28 Oct 2014 14:14:19 +0000 (10:14 -0400)
committerAustin Clements <austin@google.com>
Tue, 28 Oct 2014 14:14:19 +0000 (10:14 -0400)
The wrapper code was being emitted before the stack
reservation, rather than after.

LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/161540043

src/liblink/obj9.c

index 3db08c5450523a01d290ae87323bdb9de7c9b096..0bae64d0b8f5ce0ae4488248286103a609ec6dbb 100644 (file)
@@ -490,74 +490,74 @@ addstacksplit(Link *ctxt, LSym *cursym)
                                // It is a liblink NOP, not a Power64 NOP: it encodes to 0 instruction bytes.
 
 
-                               p = appendp(ctxt, p);
-                               p->as = AMOVD;
-                               p->from.type = D_OREG;
-                               p->from.reg = REGG;
-                               p->from.offset = 4*ctxt->arch->ptrsize; // G.panic
-                               p->to.type = D_REG;
-                               p->to.reg = 3;
-
-                               p = appendp(ctxt, p);
-                               p->as = ACMP;
-                               p->from.type = D_REG;
-                               p->from.reg = 0;
-                               p->to.type = D_REG;
-                               p->to.reg = 3;
-
-                               p = appendp(ctxt, p);
-                               p->as = ABEQ;
-                               p->to.type = D_BRANCH;
-                               p1 = p;
+                               q = appendp(ctxt, q);
+                               q->as = AMOVD;
+                               q->from.type = D_OREG;
+                               q->from.reg = REGG;
+                               q->from.offset = 4*ctxt->arch->ptrsize; // G.panic
+                               q->to.type = D_REG;
+                               q->to.reg = 3;
 
-                               p = appendp(ctxt, p);
-                               p->as = AMOVD;
-                               p->from.type = D_OREG;
-                               p->from.reg = 3;
-                               p->from.offset = 0; // Panic.argp
-                               p->to.type = D_REG;
-                               p->to.reg = 4;
+                               q = appendp(ctxt, q);
+                               q->as = ACMP;
+                               q->from.type = D_REG;
+                               q->from.reg = 0;
+                               q->to.type = D_REG;
+                               q->to.reg = 3;
+
+                               q = appendp(ctxt, q);
+                               q->as = ABEQ;
+                               q->to.type = D_BRANCH;
+                               p1 = q;
+
+                               q = appendp(ctxt, q);
+                               q->as = AMOVD;
+                               q->from.type = D_OREG;
+                               q->from.reg = 3;
+                               q->from.offset = 0; // Panic.argp
+                               q->to.type = D_REG;
+                               q->to.reg = 4;
 
-                               p = appendp(ctxt, p);
-                               p->as = AADD;
-                               p->from.type = D_CONST;
-                               p->from.offset = autosize+8;
-                               p->reg = REGSP;
-                               p->to.type = D_REG;
-                               p->to.reg = 5;
+                               q = appendp(ctxt, q);
+                               q->as = AADD;
+                               q->from.type = D_CONST;
+                               q->from.offset = autosize+8;
+                               q->reg = REGSP;
+                               q->to.type = D_REG;
+                               q->to.reg = 5;
 
-                               p = appendp(ctxt, p);
-                               p->as = ACMP;
-                               p->from.type = D_REG;
-                               p->from.reg = 4;
-                               p->to.type = D_REG;
-                               p->to.reg = 5;
+                               q = appendp(ctxt, q);
+                               q->as = ACMP;
+                               q->from.type = D_REG;
+                               q->from.reg = 4;
+                               q->to.type = D_REG;
+                               q->to.reg = 5;
 
-                               p = appendp(ctxt, p);
-                               p->as = ABNE;
-                               p->to.type = D_BRANCH;
-                               p2 = p;
+                               q = appendp(ctxt, q);
+                               q->as = ABNE;
+                               q->to.type = D_BRANCH;
+                               p2 = q;
 
-                               p = appendp(ctxt, p);
-                               p->as = AADD;
-                               p->from.type = D_CONST;
-                               p->from.offset = 8;
-                               p->reg = REGSP;
-                               p->to.type = D_REG;
-                               p->to.reg = 6;
-
-                               p = appendp(ctxt, p);
-                               p->as = AMOVD;
-                               p->from.type = D_REG;
-                               p->from.reg = 6;
-                               p->to.type = D_OREG;
-                               p->to.reg = 3;
-                               p->to.offset = 0; // Panic.argp
-
-                               p = appendp(ctxt, p);
-                               p->as = ANOP;
-                               p1->pcond = p;
-                               p2->pcond = p;
+                               q = appendp(ctxt, q);
+                               q->as = AADD;
+                               q->from.type = D_CONST;
+                               q->from.offset = 8;
+                               q->reg = REGSP;
+                               q->to.type = D_REG;
+                               q->to.reg = 6;
+
+                               q = appendp(ctxt, q);
+                               q->as = AMOVD;
+                               q->from.type = D_REG;
+                               q->from.reg = 6;
+                               q->to.type = D_OREG;
+                               q->to.reg = 3;
+                               q->to.offset = 0; // Panic.argp
+
+                               q = appendp(ctxt, q);
+                               q->as = ANOP;
+                               p1->pcond = q;
+                               p2->pcond = q;
                        }
 
                        break;