X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic%2Fgen.c;h=1189c3607d38e85514974140de8ba63fc9cff657;hb=81cd49cd3298b973e88c4b9cdce1fa6f86a2f2b0;hp=a410c47cb0a30fd6d51481bb34894d4963bc824b;hpb=c2f2abbf9d58d7f0def3509779547f50ade2e2ab;p=fw%2Fsdcc diff --git a/src/pic/gen.c b/src/pic/gen.c index a410c47c..1189c360 100644 --- a/src/pic/gen.c +++ b/src/pic/gen.c @@ -942,9 +942,12 @@ void aopOp (operand *op, iCode *ic, bool result) /* else spill location */ if (sym->usl.spillLoc) { + asmop *oldAsmOp = NULL; + if (getSize(sym->type) != getSize(sym->usl.spillLoc->type)) { /* force a new aop if sizes differ */ + oldAsmOp = sym->usl.spillLoc->aop; sym->usl.spillLoc->aop = NULL; } DEBUGpic14_emitcode(";","%s %d %s sym->rname = %s, offset %d", @@ -953,6 +956,11 @@ void aopOp (operand *op, iCode *ic, bool result) sym->rname, sym->usl.spillLoc->offset); sym->aop = op->aop = aop = newAsmop(AOP_PCODE); + if (getSize(sym->type) != getSize(sym->usl.spillLoc->type)) + { + /* Don't reuse the new aop, go with the last one */ + sym->usl.spillLoc->aop = oldAsmOp; + } //aop->aopu.pcop = popGetImmd(sym->usl.spillLoc->rname,0,sym->usl.spillLoc->offset); aop->aopu.pcop = popRegFromString(sym->usl.spillLoc->rname, getSize(sym->type),