temporarily turn it off ; we also
turn off memory model to prevent
the spil from going to the external storage
- and turn off overlaying
*/
useXstack = options.useXstack;
model = options.model;
- noOverlay = options.noOverlay;
- options.noOverlay = 1;
+/* noOverlay = options.noOverlay; */
+/* options.noOverlay = 1; */
options.model = options.useXstack = 0;
allocLocal(sloc);
options.useXstack = useXstack;
options.model = model;
- options.noOverlay = noOverlay;
+/* options.noOverlay = noOverlay; */
sloc->isref = 1; /* to prevent compiler warning */
/* if it is on the stack then update the stack */
used in the remainder of the block */
if (!_G.blockSpil && (selectS = liveRangesWith(lrcs,notUsedInRemaining,ebp,ic))) {
sym = leastUsedLR (selectS);
- if (!sym->remat) {
- sym->remainSpil = 1;
- _G.blockSpil++;
+ if (sym != forSym) {
+ if (!sym->remat) {
+ sym->remainSpil = 1;
+ _G.blockSpil++;
+ }
+ return sym;
}
- return sym;
}
}
sym->nRegs) >= result->nRegs)
) {
- for (i = 0 ; i < max(sym->nRegs,result->nRegs) ; i++)
+ for (i = 0 ; i < result->nRegs ; i++)
if (i < sym->nRegs )
result->regs[i] = sym->regs[i] ;
else
/* also make sure the intervenening instructions
don't have any thing in far space */
- for (dic = dic->next ; dic && dic != ic ; dic = dic->next) {
+ for (dic = dic->next ; dic && dic != ic && sic != ic; dic = dic->next) {
/* if there is an intervening function call then no */
if (dic->op == CALL || dic->op == PCALL)
can be eliminated for return statements */
if ((ic->op == RETURN || ic->op == SEND) &&
!isOperandInFarSpace(IC_LEFT(ic)) &&
- !options.model)
+ options.model == MODEL_SMALL)
packRegsForOneuse (ic,IC_LEFT(ic),ebp);
/* if pointer set & left has a size more than
/* redo that offsets for stacked automatic variables */
redoStackOffsets ();
- if (options.dump_rassgn)
+ if (options.dump_rassgn) {
dumpEbbsToFileExt(".dumprassgn",ebbs,count);
+ dumpLiveRanges(".lrange",liveRanges);
+ }
+
+ /* do the overlaysegment stuff SDCCmem.c */
+ doOverlays(ebbs,count);
/* now get back the chain */
ic = iCodeLabelOptimize(iCodeFromeBBlock (ebbs,count));