+2006-10-16 Raphael Neider <rneider AT web.de>
+
+ * src/pic/pcode.c (BankSelect): another fix on (partial) BANKSELs,
+ fixes #1577882, removes close to all banking optimizations
+
2006-10-15 Maarten Brock <sourceforge.brock AT dse.nl>
* src/SDCCsymt.c (checkSClass): no error for uninitialised absolute
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
+#if 0
static void insertBankSwitch(pCodeInstruction *pci, int Set_Clear, int RP_BankBit)
{
pCode *new_pc;
insertPCodeInstruction(pci, PCI(new_pc));
}
-
+#endif
/*-----------------------------------------------------------------*/
/*-----------------------------------------------------------------*/
static void insertBankSel(pCodeInstruction *pci, const char *name)
static int LastRegIdx = -1; /* If the previous register is the same one again then no need to change bank. */
static int BankSelect(pCodeInstruction *pci, int cur_bank, regs *reg)
{
+#if 1
+ /* Always insert BANKSELs rather than try to be clever:
+ * Too many bugs in optimized banksels... */
+ insertBankSel(pci, reg->name); // Let linker choose the bank selection
+ return 'L';
+#else
int bank;
int a = reg->alias>>7;
if ((a&3) == 3) {
LastRegIdx = reg->rIdx;
#endif
+ /* Optimized code---unfortunately this turns out to be buggy
+ * (at least on devices with more than two banks). */
if (reg->isFixed) {
bank = REG_BANK(reg);
} else if (reg->isExtern) {
}
return bank;
+#endif
}
/*-----------------------------------------------------------------*/