From: tecodev Date: Mon, 16 Oct 2006 08:26:54 +0000 (+0000) Subject: * src/pic/pcode.c (BankSelect): another fix on (partial) BANKSELs, X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=8cb6ad0f787e4b5b291984096928a669a6b07b7d;p=fw%2Fsdcc * src/pic/pcode.c (BankSelect): another fix on (partial) BANKSELs, fixes #1577882, removes close to all banking optimizations git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4411 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index cd969b3b..844ff842 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-10-16 Raphael Neider + + * src/pic/pcode.c (BankSelect): another fix on (partial) BANKSELs, + fixes #1577882, removes close to all banking optimizations + 2006-10-15 Maarten Brock * src/SDCCsymt.c (checkSClass): no error for uninitialised absolute diff --git a/src/pic/pcode.c b/src/pic/pcode.c index 1951de07..fe75ecf7 100644 --- a/src/pic/pcode.c +++ b/src/pic/pcode.c @@ -4541,6 +4541,7 @@ static void insertPCodeInstruction(pCodeInstruction *pci, pCodeInstruction *new_ /*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/ +#if 0 static void insertBankSwitch(pCodeInstruction *pci, int Set_Clear, int RP_BankBit) { pCode *new_pc; @@ -4549,7 +4550,7 @@ static void insertBankSwitch(pCodeInstruction *pci, int Set_Clear, int RP_BankBi insertPCodeInstruction(pci, PCI(new_pc)); } - +#endif /*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/ static void insertBankSel(pCodeInstruction *pci, const char *name) @@ -4583,6 +4584,12 @@ 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) { @@ -4607,6 +4614,8 @@ static int BankSelect(pCodeInstruction *pci, int cur_bank, regs *reg) 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) { @@ -4639,6 +4648,7 @@ static int BankSelect(pCodeInstruction *pci, int cur_bank, regs *reg) } return bank; +#endif } /*-----------------------------------------------------------------*/