into the addressable range (0..0xFFF), workaround for a gpsim
bug preventing simulation of regtest bug1750318
* src/pic16/ralloc.c (deassignLRs): cosmetic changes,
(serialRegAssign): fixed regtest bug-971834,
(pic16_packRegisters): avoid null-pointer dereference
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5238
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2008-09-15 Raphael Neider <rneider AT web.de>
+
+ * src/pic16/device.c (pic16_dump_usection): force udata sections
+ into the addressable range (0..0xFFF), workaround for a gpsim
+ bug preventing simulation of regtest bug1750318
+ * src/pic16/ralloc.c (deassignLRs): cosmetic changes,
+ (serialRegAssign): fixed regtest bug-971834,
+ (pic16_packRegisters): avoid null-pointer dereference
+
2008-09-14 Raphael Neider <rneider AT web.de>
* src/pic16/gen.c, src/pic16/ralloc.c: use
2008-09-14 Raphael Neider <rneider AT web.de>
* src/pic16/gen.c, src/pic16/ralloc.c: use
#endif
} else {
unsigned int j=0;
#endif
} else {
unsigned int j=0;
- init_addr = rlist[j]->address;
- deb_addr = init_addr;
- fprintf(of, "\n\nustat_%s_%02d\tudata\t0X%04X\n", moduleName, abs_usection_no++, init_addr);
+ init_addr = (rlist[j]->address & 0x0FFF); // warning(s) emitted below
+ fprintf(of, "\n\nustat_%s_%02d\tudata\t0X%04X\n", moduleName, abs_usection_no++, (init_addr & 0x0FFF));
for(j=0;j<i;j++) {
r = rlist[j];
if(j < i-1)r1 = rlist[j+1]; else r1 = NULL;
for(j=0;j<i;j++) {
r = rlist[j];
if(j < i-1)r1 = rlist[j+1]; else r1 = NULL;
- init_addr = r->address;
- deb_addr = init_addr;
+ init_addr = (r->address & 0x0FFF);
+ if (init_addr != r->address) {
+ fprintf (stderr, "%s: WARNING: Changed address of pinned variable %s from 0x%x to 0x%x\n",
+ moduleName, r->name, r->address, init_addr);
+ } // if
- if((rprev && (init_addr > (rprev->address + rprev->size)))) {
+ if((rprev && (init_addr != ((rprev->address & 0x0FFF) + rprev->size)))) {
fprintf(of, "\n\nustat_%s_%02d\tudata\t0X%04X\n", moduleName, abs_usection_no++, init_addr);
}
fprintf(of, "\n\nustat_%s_%02d\tudata\t0X%04X\n", moduleName, abs_usection_no++, init_addr);
}
- if(r1 && (init_addr == r1->address)) {
+ /* XXX: Does not handle partial overlap correctly. */
+ if(r1 && (init_addr == (r1->address & 0x0FFF))) {
fprintf(of, "\n%s\tres\t0\n", r->name);
} else {
fprintf(of, "%s\tres\t%d\n", r->name, r->size);
fprintf(of, "\n%s\tres\t0\n", r->name);
} else {
fprintf(of, "%s\tres\t%d\n", r->name, r->size);
statistics.udsize += r->size;
}
statistics.udsize += r->size;
}
-
-// for (i = 0; i < max (sym->nRegs, result->nRegs); i++)
- /* the above does not free the unsued registers in sym,
- * leaving them marked as used, and increasing register usage
- * until the end of the function - VR 23/11/05 */
-
for (i = 0; i < result->nRegs; i++)
if (i < sym->nRegs)
result->regs[i] = sym->regs[i];
for (i = 0; i < result->nRegs; i++)
if (i < sym->nRegs)
result->regs[i] = sym->regs[i];
result->regs[i] = getRegGpr (ic, ebp, result);
_G.regAssigned = bitVectSetBit (_G.regAssigned, result->key);
result->regs[i] = getRegGpr (ic, ebp, result);
_G.regAssigned = bitVectSetBit (_G.regAssigned, result->key);
}
/* free the remaining */
}
/* free the remaining */
have been allocated after sym->liveFrom but freed
before ic->seq. This is complicated, so spill this
symbol instead and let fillGaps handle the allocation. */
have been allocated after sym->liveFrom but freed
before ic->seq. This is complicated, so spill this
symbol instead and let fillGaps handle the allocation. */
if (sym->liveFrom < ic->seq)
{
spillThis (sym);
continue;
}
if (sym->liveFrom < ic->seq)
{
spillThis (sym);
continue;
}
/* if it has a spillocation & is used less than
all other live ranges then spill this */
if (willCS) {
/* if it has a spillocation & is used less than
all other live ranges then spill this */
if (willCS) {
#endif
/* mark the pointer usages */
#endif
/* mark the pointer usages */
+ if (POINTER_SET (ic) && IS_SYMOP (IC_RESULT (ic)))
{
OP_SYMBOL (IC_RESULT (ic))->uptr = 1;
debugLog (" marking as a pointer (set) =>");
{
OP_SYMBOL (IC_RESULT (ic))->uptr = 1;
debugLog (" marking as a pointer (set) =>");