like CODE pointers, fixes #
1115683
* src/pic/pcode.c (DoBankSelect): forget LastRegIdx during function
call, fixes bugs #
1232211, #
1228110,
fixed wrong casts to pCodeFlow from pCodeInstructions
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3794
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2005-07-04 Raphael Neider <rneider AT web.de>
+
+ * src/pic/gen.c (genPointerGet): handle pointers to CONST values
+ like CODE pointers, fixes #1115683
+ * src/pic/pcode.c (DoBankSelect): forget LastRegIdx during function
+ call, fixes bugs #1232211, #1228110,
+ fixed wrong casts to pCodeFlow from pCodeInstructions
+
2005-07-04 Raphael Neider <rneider AT web.de>
* src/pic/gen.c (popGet): changed assert to allow for
break;
case GPOINTER:
- if (IS_CODEPTR(type) || IS_PTR_CONST(type))
+ if (IS_CODEPTR(type) || IS_PTR_CONST(type) || SPEC_CONST(etype))
genConstPointerGet (left,result,ic);
else
genGenPointerGet (left,result,ic);
}
}
+#if 1
if (LastRegIdx == reg->rIdx) // If this is the same register as last time then it is in same bank
return cur_bank;
LastRegIdx = reg->rIdx;
+#endif
if (reg->isFixed) {
bank = REG_BANK(reg);
if (isCALL(pc)) {
pCode *pcf = findFunction(get_op_from_instruction(PCI(pc)));
+ LastRegIdx = -1; /* do not know which register is touched in the called function... */
if (pcf && isPCF(pcf)) {
pCode *pcfr;
int rbank = 'U'; // Undetermined
if (isPCI(pcfr)) {
if ((PCI(pcfr)->op==POC_RETURN) || (PCI(pcfr)->op==POC_RETLW)) {
if (rbank == 'U')
- rbank = PCFL(pcfr)->lastBank;
+ rbank = PCI(pcfr)->pcflow->lastBank;
else
- if (rbank != PCFL(pcfr)->lastBank)
+ if (rbank != PCI(pcfr)->pcflow->lastBank)
return -1; // Unknown bank - multiple returns with different banks
}
}
/* Extern functions may use registers in different bank - must call banksel */
return -1; /* Unknown bank */
}
+ /* play safe... */
+ return -1;
}
if ((isPCI(pc)) && (PCI(pc)->op == POC_BANKSEL)) {