#include "pcode.h"
#include "gen.h"
-#if defined(_MSC_VER)
-#define __FUNCTION__ __FILE__
-#endif
-
/*-----------------------------------------------------------------*/
/* At this point we start getting processor specific although */
/* some routines are non-processor specific & can be reused when */
return "RANGE";
case FAR:
return "FAR";
- case _XDATA:
- return "_XDATA";
- case _CODE:
- return "_CODE";
- case _GENERIC:
- return "_GENERIC";
- case _NEAR:
- return "_NEAR";
- case _PDATA:
- return "_PDATA";
- case _IDATA:
- return "_IDATA";
- case _EEPROM:
- return "_EEPROM";
case CASE:
return "CASE";
case DEFAULT:
/* if it has a spillocation & is used less than
all other live ranges then spill this */
- if (willCS && sym->usl.spillLoc)
- {
-
- symbol *leastUsed =
- leastUsedLR (liveRangesWith (spillable,
- allLRs,
- ebbs[i],
- ic));
- if (leastUsed &&
- leastUsed->used > sym->used)
- {
- spillThis (sym);
- continue;
+ if (willCS) {
+ if (sym->usl.spillLoc) {
+ symbol *leastUsed = leastUsedLR (liveRangesWith (spillable,
+ allLRs, ebbs[i], ic));
+ if (leastUsed && leastUsed->used > sym->used) {
+ spillThis (sym);
+ continue;
+ }
+ } else {
+ /* if none of the liveRanges have a spillLocation then better
+ to spill this one than anything else already assigned to registers */
+ if (liveRangesWith(spillable,noSpilLoc,ebbs[i],ic)) {
+ spillThis (sym);
+ continue;
+ }
}
}
/* if we need ptr regs for the right side
then mark it */
if (POINTER_GET (ic) && getSize (OP_SYMBOL (IC_LEFT (ic))->type)
- <= PTRSIZE)
+ <= (unsigned) PTRSIZE)
{
pic14_ptrRegReq++;
ptrRegSet = 1;
(ic = hTabItemWithKey (iCodehTab,
bitVectFirstBit (sym->defs))) &&
POINTER_GET (ic) &&
+ !sym->noSpilLoc &&
!IS_BITVAR (sym->etype))
{
packForReceive (iCode * ic, eBBlock * ebp)
{
iCode *dic;
- bool can_remove = 1; // assume that we can remove temporary
debugLog ("%s\n", __FUNCTION__);
debugAopGet (" result:", IC_RESULT (ic));
/* if the type from and type to are the same
then if this is the only use then packit */
- if (checkType (operandType (IC_RIGHT (ic)),
+ if (compareType (operandType (IC_RIGHT (ic)),
operandType (IC_LEFT (ic))) == 1)
{
iCode *dic = packRegsForOneuse (ic, IC_RIGHT (ic), ebp);
packRegisters (ebbs[i]);
if (options.dump_pack)
- dumpEbbsToFileExt (".dumppack", ebbs, count);
+ dumpEbbsToFileExt (DUMP_PACK, ebbs, count);
/* first determine for each live range the number of
registers & the type of registers required for each */
redoStackOffsets ();
if (options.dump_rassgn)
- dumpEbbsToFileExt (".dumprassgn", ebbs, count);
+ dumpEbbsToFileExt (DUMP_RASSGN, ebbs, count);
/* now get back the chain */
ic = iCodeLabelOptimize (iCodeFromeBBlock (ebbs, count));