From e642503d6fed2d64c87e3f77283f9497f81f22ae Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 29 Sep 2010 15:10:14 -0400 Subject: [PATCH] 6l, 8l: fix -K implementation R=ken2 CC=golang-dev https://golang.org/cl/2313041 --- src/cmd/6l/pass.c | 33 +++++---------------------------- src/cmd/8l/pass.c | 12 ++++-------- 2 files changed, 9 insertions(+), 36 deletions(-) diff --git a/src/cmd/6l/pass.c b/src/cmd/6l/pass.c index d207e74832..115aee6946 100644 --- a/src/cmd/6l/pass.c +++ b/src/cmd/6l/pass.c @@ -716,6 +716,11 @@ dostkoff(void) p->as = AINT; p->from.type = D_CONST; p->from.offset = 3; + + p = appendp(p); + p->as = ANOP; + q1->pcond = p; + q1 = P; } if(autoffset < StackBig) { // do we need to call morestack? @@ -725,10 +730,6 @@ dostkoff(void) p->as = ACMPQ; p->from.type = D_SP; p->to.type = D_INDIR+D_CX; - if(q1) { - q1->pcond = p; - q1 = P; - } } else { // large stack p = appendp(p); @@ -736,10 +737,6 @@ dostkoff(void) p->from.type = D_INDIR+D_SP; p->from.offset = -(autoffset-StackSmall); p->to.type = D_AX; - if(q1) { - q1->pcond = p; - q1 = P; - } p = appendp(p); p->as = ACMPQ; @@ -769,20 +766,12 @@ dostkoff(void) p->to.type = D_BRANCH; p->pcond = pmorestack[0]; p->to.sym = symmorestack[0]; - if(q1) { - q1->pcond = p; - q1 = P; - } } else if(moreconst1 != 0 && moreconst2 == 0) { p->as = AMOVL; p->from.type = D_CONST; p->from.offset = moreconst1; p->to.type = D_AX; - if(q1) { - q1->pcond = p; - q1 = P; - } p = appendp(p); p->as = ACALL; @@ -796,20 +785,12 @@ dostkoff(void) p->to.type = D_BRANCH; p->pcond = pmorestack[i]; p->to.sym = symmorestack[i]; - if(q1) { - q1->pcond = p; - q1 = P; - } } else if(moreconst1 == 0 && moreconst2 != 0) { p->as = AMOVL; p->from.type = D_CONST; p->from.offset = moreconst2; p->to.type = D_AX; - if(q1) { - q1->pcond = p; - q1 = P; - } p = appendp(p); p->as = ACALL; @@ -822,10 +803,6 @@ dostkoff(void) p->from.offset = (uint64)moreconst2 << 32; p->from.offset |= moreconst1; p->to.type = D_AX; - if(q1) { - q1->pcond = p; - q1 = P; - } p = appendp(p); p->as = ACALL; diff --git a/src/cmd/8l/pass.c b/src/cmd/8l/pass.c index f59ccdb61e..f55e9a02d8 100644 --- a/src/cmd/8l/pass.c +++ b/src/cmd/8l/pass.c @@ -701,6 +701,10 @@ dostkoff(void) p->as = AINT; p->from.type = D_CONST; p->from.offset = 3; + + p = appendp(p); + p->as = ANOP; + q1->pcond = p; } if(autoffset < StackBig) { // do we need to call morestack @@ -710,10 +714,6 @@ dostkoff(void) p->as = ACMPL; p->from.type = D_SP; p->to.type = D_INDIR+D_CX; - if(q1) { - q1->pcond = p; - q1 = P; - } } else { // large stack p = appendp(p); @@ -721,10 +721,6 @@ dostkoff(void) p->from.type = D_INDIR+D_SP; p->from.offset = -(autoffset-StackSmall); p->to.type = D_AX; - if(q1) { - q1->pcond = p; - q1 = P; - } p = appendp(p); p->as = ACMPL;