X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fz80%2Fralloc.c;h=6e97b1da76c1f751639d006f6ba5fd1a057b4007;hb=0b44824662442b40830512786321baa59f2d3a97;hp=b23b4b221e41543f502ba3d71f37643eaa8d7238;hpb=9248424afe9fba758b93efc95507178dc2d15442;p=fw%2Fsdcc diff --git a/src/z80/ralloc.c b/src/z80/ralloc.c index b23b4b22..6e97b1da 100644 --- a/src/z80/ralloc.c +++ b/src/z80/ralloc.c @@ -1308,10 +1308,25 @@ static void fillGaps() if (pdone > 1) break; } } + for (i = 0 ; i < sym->uses->size ; i++ ) { + if (bitVectBitValue(sym->uses,i)) { + iCode *ic; + if (!(ic = hTabItemWithKey(iCodehTab,i))) continue ; + if (SKIP_IC(ic)) continue; + if (!IS_ASSIGN_ICODE(ic)) continue ; + + /* if result is assigned to registers */ + if (IS_SYMOP(IC_RESULT(ic)) && + bitVectBitValue(_G.totRegAssigned,OP_SYMBOL(IC_RESULT(ic))->key)) { + pdone += positionRegs(sym,OP_SYMBOL(IC_RESULT(ic))); + } + if (pdone > 1) break; + } + } /* had to position more than once GIVE UP */ if (pdone > 1) { /* UNDO all the changes we made to try this */ - sym->isspilt = 0; + sym->isspilt = 1; for (i=0; i < sym->nRegs ; i++ ) { sym->regs[i] = NULL; } @@ -2427,6 +2442,12 @@ packRegsForIYUse (iCode * lic, operand * op, eBBlock * ebp) return NULL; } + if (getSize (operandType (op)) != 2) + { + D (D_ACCUSE2, (" + Dropping as operation has size is too big\n")); + return FALSE; + } + /* Nothing else that clashes with this is using the scratch register. Scan through all of the intermediate instructions and see if any of them could nuke HL.