From: Shenghou Ma Date: Fri, 15 Aug 2014 19:31:54 +0000 (-0400) Subject: [dev.power64] liblink: fix g->panicwrap update code generation X-Git-Tag: go1.5beta1~2684^2~25^2~20 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d0be55a66242cd8bea2f40b7ceca4b3651d0b720;p=gostls13.git [dev.power64] liblink: fix g->panicwrap update code generation LGTM=rsc R=golang-codereviews, rsc CC=golang-codereviews https://golang.org/cl/123400043 --- diff --git a/src/liblink/obj9.c b/src/liblink/obj9.c index 3405fce477..28793676cc 100644 --- a/src/liblink/obj9.c +++ b/src/liblink/obj9.c @@ -512,6 +512,36 @@ addstacksplit(Link *ctxt, LSym *cursym) p->to.type = D_BRANCH; break; } + if(cursym->text->reg & WRAPPER) { + // g->panicwrap -= autosize; + // MOVWZ panicwrap_offset(g), R3 + // ADD $-autosize, R3 + // MOVWZ R3, panicwrap_offset(g) + p->as = AMOVWZ; + p->from.type = D_OREG; + p->from.reg = REGG; + p->from.offset = 2*ctxt->arch->ptrsize; + p->to.type = D_REG; + p->to.reg = 3; + p = appendp(ctxt, p); + + p->as = AADD; + p->from.type = D_CONST; + p->from.offset = -autosize; + p->to.type = D_REG; + p->to.reg = 3; + p = appendp(ctxt, p); + + p->as = AMOVWZ; + p->from.type = D_REG; + p->from.reg = 3; + p->to.type = D_OREG; + p->to.reg = REGG; + p->to.offset = 2*ctxt->arch->ptrsize; + p = appendp(ctxt, p); + + p->as = ARETURN; + } if(cursym->text->mark & LEAF) { if(!autosize) { p->as = ABR;