{
currFunc->regsUsed = bitVectSetBit (currFunc->regsUsed, i);
}
- D (D_ALLOC, ("allocReg: alloced %p\n", ®sZ80[i]));
+ D (D_ALLOC, ("allocReg: alloced %s\n", regsZ80[i].name));
return ®sZ80[i];
}
}
currFunc->regsUsed =
bitVectSetBit (currFunc->regsUsed, i + 1);
}
- D (D_ALLOC, ("tryAllocRegPair: succeded for sym %p\n", sym));
+ D (D_ALLOC, ("tryAllocatingRegPair: succeded for sym %p\n", sym));
return TRUE;
}
}
- D (D_ALLOC, ("tryAllocRegPair: failed on sym %p\n", sym));
+ D (D_ALLOC, ("tryAllocatingRegPair: failed on sym %p\n", sym));
return FALSE;
}
break;
}
}
+ /* Make sure we didn't allocate a register pair with bytes swapped */
+ if(sym->nRegs == 2 && sym->regs[0] == sym->regs[1] + 1 && sym->regs[0] != ®sZ80[2])
+ {
+ freeReg(sym->regs[0]);
+ freeReg(sym->regs[1]);
+ if(!tryAllocatingRegPair(sym))
+ wassertl(0, "Failed to swap register pair bytes back.");
+ }
}
/* if it shares registers with operands make sure
that they are in the same position */
}
#endif
-#define IS_OP_RUONLY(x) (x && IS_SYMOP(x) && OP_SYMBOL(x)->ruonly)
-
/** Will reduce some registers for single use.
*/
static iCode *
D (D_ACCUSE2_VERBOSE, (" ! Preserves A, so continue scanning\n"));
scan = next;
}
- else if (scan->next == NULL && bitVectnBitsOn (uses) == 1 && next != NULL)
+ /*else if (scan->next == NULL && bitVectnBitsOn (uses) == 1 && next != NULL)
{
if (next->prev == NULL)
{
D (D_ACCUSE2, (" + Dropping as last in list and next doesn't start a block\n"));
return;
}
- }
+ } //This caused bug #1292721 */
else if (scan->next == NULL)
{
D (D_ACCUSE2, (" + Dropping as hit the end of the list\n"));
!POINTER_SET (ic) &&
IS_SYMOP (IC_RIGHT (ic)) &&
OP_SYMBOL (IC_RIGHT (ic))->remat &&
+ !IS_CAST_ICODE(OP_SYMBOL (IC_RIGHT (ic))->rematiCode) &&
+ !isOperandGlobal(IC_RESULT(ic)) && /* due to bug 1618050 */
bitVectnBitsOn (OP_SYMBOL (IC_RESULT (ic))->defs) <= 1)
{
-
OP_SYMBOL (IC_RESULT (ic))->remat =
OP_SYMBOL (IC_RIGHT (ic))->remat;
OP_SYMBOL (IC_RESULT (ic))->rematiCode =