From: epetrich Date: Thu, 12 Feb 2004 07:37:22 +0000 (+0000) Subject: * src/hc08/gen.h, X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=a23f3cd79101738461e34f6842816fec9e5214f1;p=fw%2Fsdcc * src/hc08/gen.h, * src/hc08/gen.c (storeRegToAop, aopOp, aopAdrStr, accopWithAop, rmwWithAop): Ported my 2004-10-02 fix for bug #663539 to the hc08, thus fixing bug #895406 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3193 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 1c8a3a10..6968afa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-02-12 Erik Petrich + + * src/hc08/gen.h, + * src/hc08/gen.c (storeRegToAop, aopOp, aopAdrStr, accopWithAop, + rmwWithAop): Ported my 2004-10-02 fix for bug #663539 to the hc08, + thus fixing bug #895406 + 2004-02-11 Bernhard Held * device/lib/_modsint.c, diff --git a/src/hc08/gen.c b/src/hc08/gen.c index 97748e37..b515ed79 100644 --- a/src/hc08/gen.c +++ b/src/hc08/gen.c @@ -762,7 +762,10 @@ storeRegToAop (regs *reg, asmop *aop, int loffset) return; } - switch (regidx) + if (aop->type == AOP_DUMMY) + return; + + switch (regidx) { case A_IDX: if ((aop->type == AOP_REG) && (loffset < aop->size)) @@ -945,6 +948,8 @@ storeConstToAop (char *c, asmop *aop, int loffset) break; loadRegFromConst (aop->aopu.aop_reg[loffset], c); break; + case AOP_DUMMY: + break; default: if (hc08_reg_a->isFree) { @@ -1155,7 +1160,10 @@ accopWithAop (char *accop, asmop *aop, int loffset) accopWithAop (accop, aop->stk_aop[loffset], 0); return; } - + + if (aop->type == AOP_DUMMY) + return; + if (aop->type == AOP_REG) { pushReg (aop->aopu.aop_reg[loffset], FALSE); @@ -1238,6 +1246,8 @@ rmwWithAop (char *rmwop, asmop *aop, int loffset) storeRegToAop (hc08_reg_a, aop, loffset); pullOrFreeReg (hc08_reg_a, needpula); break; + case AOP_DUMMY: + break; default: emitcode (rmwop, "%s", aopAdrStr (aop, loffset, FALSE)); } @@ -1689,27 +1699,27 @@ aopOp (operand * op, iCode * ic, bool result) } #endif /* else spill location */ -// printf("checking spill loc\n"); -// if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { - if (sym->usl.spillLoc && sym->usl.spillLoc->aop - && sym->usl.spillLoc->aop->size != getSize (sym->type)) + if (sym->usl.spillLoc) { - /* force a new aop if sizes differ */ - sym->usl.spillLoc->aop = NULL; - //printf ("forcing new aop\n"); - } - sym->aop = op->aop = aop = - aopForSym (ic, sym->usl.spillLoc, result); + if (sym->usl.spillLoc->aop + && sym->usl.spillLoc->aop->size != getSize (sym->type)) + { + /* force a new aop if sizes differ */ + sym->usl.spillLoc->aop = NULL; + //printf ("forcing new aop\n"); + } + sym->aop = op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result); + aop->size = getSize (sym->type); + aop->op = op; + aop->isaddr = op->isaddr; + //printf ("spill symbol %s\n", OP_SYMBOL (op)->name); + //printf (" with size = %d\n", aop->size); + return; + } + + /* else must be a dummy iTemp */ + sym->aop = op->aop = aop = newAsmop (AOP_DUMMY); aop->size = getSize (sym->type); - aop->op = op; - aop->isaddr = op->isaddr; - //printf ("spill symbol %s\n", OP_SYMBOL (op)->name); - //printf (" with size = %d\n", aop->size); - /* if (aop->isaddr & IS_ITEMP (op)) - { - aop->psize=aop->size; - aop->size = getSize( operandType (op)->next); - } */ return; } @@ -1871,6 +1881,9 @@ aopAdrStr (asmop * aop, int loffset, bool bit16) switch (aop->type) { + case AOP_DUMMY: + return zero; + case AOP_IMMD: if (aop->aopu.aop_immd.from_cast_remat && (loffset == (aop->size-1))) { sprintf(s,"%s",aop->aopu.aop_immd.aop_immd2); @@ -3427,7 +3440,7 @@ genMultOneByte (operand * left, operand * right, operand * result) { - sym_link *opetype = operandType (result); + /* sym_link *opetype = operandType (result); */ symbol *tlbl1, *tlbl2, *tlbl3, *tlbl4; int size=AOP_SIZE(result); bool negLiteral = FALSE; diff --git a/src/hc08/gen.h b/src/hc08/gen.h index fd9ae77a..f1463a58 100644 --- a/src/hc08/gen.h +++ b/src/hc08/gen.h @@ -31,7 +31,7 @@ enum AOP_REG, AOP_DIR, AOP_STK, AOP_IMMD, AOP_STR, AOP_CRY, - AOP_EXT, AOP_SOF, + AOP_EXT, AOP_SOF, AOP_DUMMY }; enum