X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fds390%2Fralloc.c;h=3e39ee755ef144c49bc10ec9a805493c3ecadecb;hb=0ddac837e50a0bcf1e3ddf35542eb65a8c158020;hp=def06af2e1a9e36dcb04af4227b3db8a0a17ec9f;hpb=6401e66edb7cff7794e45b323eddab1a5de0e0af;p=fw%2Fsdcc diff --git a/src/ds390/ralloc.c b/src/ds390/ralloc.c index def06af2..3e39ee75 100644 --- a/src/ds390/ralloc.c +++ b/src/ds390/ralloc.c @@ -1271,7 +1271,7 @@ serialRegAssign (eBBlock ** ebbs, int count) unusedLRs = deassignUnsedLRs(ebbs[i]); - /* of all instructions do */ + /* for all instructions do */ for (ic = ebbs[i]->sch; ic; ic = ic->next) { @@ -1307,6 +1307,13 @@ serialRegAssign (eBBlock ** ebbs, int count) int willCS; int j; int ptrRegSet = 0; + + /* Make sure any spill location is definately allocated */ + if (sym->isspilt && !sym->remat && sym->usl.spillLoc && + !sym->usl.spillLoc->allocreq) + { + sym->usl.spillLoc->allocreq++; + } /* if it does not need or is spilt or is already assigned to registers @@ -1325,6 +1332,16 @@ serialRegAssign (eBBlock ** ebbs, int count) spillThis (sym); continue; } + + /* if this is a bit variable then don't use precious registers + along with expensive bit-to-char conversions but just spill + it */ + if (SPEC_NOUN(sym->etype) == V_BIT) + { + spillThis (sym); + continue; + } + /* if trying to allocate this will cause a spill and there is nothing to spill or this one is rematerializable then @@ -3107,8 +3124,10 @@ packRegisters (eBBlock * ebp) /* assignRegisters - assigns registers to each live range as need */ /*-----------------------------------------------------------------*/ void -ds390_assignRegisters (eBBlock ** ebbs, int count) +ds390_assignRegisters (ebbIndex * ebbi) { + eBBlock ** ebbs = ebbi->bbOrder; + int count = ebbi->count; iCode *ic; int i; @@ -3129,7 +3148,7 @@ ds390_assignRegisters (eBBlock ** ebbs, int count) recomputeLiveRanges (ebbs, count); if (options.dump_pack) - dumpEbbsToFileExt (DUMP_PACK, ebbs, count); + dumpEbbsToFileExt (DUMP_PACK, ebbi); /* first determine for each live range the number of registers & the type of registers required for each */ @@ -3175,7 +3194,7 @@ ds390_assignRegisters (eBBlock ** ebbs, int count) } if (options.dump_rassgn) { - dumpEbbsToFileExt (DUMP_RASSGN, ebbs, count); + dumpEbbsToFileExt (DUMP_RASSGN, ebbi); dumpLiveRanges (DUMP_LRANGE, liveRanges); }