* fixed bug 1045046 - SIGSEGV with really simple code?:
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 14 Apr 2005 18:45:46 +0000 (18:45 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 14 Apr 2005 18:45:46 +0000 (18:45 +0000)
  src/pic16/pcode.c (pCodeInitRegisters)- pseudo stack size increased to 16
  src/pic16/ralloc.c (typeRegWithIdx) - error message on pseudo stack overflow

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3739 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/pic/pcode.c
src/pic/ralloc.c

index 95f99f2f74bd3962caa4745246a10217f3ad6ada..fe258f801d0a0818b6db49e0183766e001074728 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-14 Borut Razem <borut.razem AT siol.net>
+
+       * fixed bug 1045046 - SIGSEGV with really simple code?:
+         src/pic16/pcode.c (pCodeInitRegisters)- pseudo stack size increased to 16
+         src/pic16/ralloc.c (typeRegWithIdx) - error message on pseudo stack overflow
+
 2005-04-14 Borut Razem <borut.razem AT siol.net>
 
        * src/pic16/gen.c (genInline), src/pic16/main.c (_process_pragma),
index 03d701b33ab23e417ad2a0ed512bf6e0d1a3089a..6da0b7dd82e117fb60b1a1a75b1a273c4486be83 100644 (file)
@@ -1344,7 +1344,8 @@ void  pCodeInitRegisters(void)
        initialized = 1;
        
        shareBankAddress = 0x7f; /* FIXME - some PIC ICs like 16C7X which do not have a shared bank need a different approach. */
-       stkSize = 8; // Set pseudo stack size to 8
+//     stkSize = 8; // Set pseudo stack size to 8
+       stkSize = 16; // Set pseudo stack size to 16
        initStack(shareBankAddress, stkSize); // Putting the pseudo stack in shared memory so all modules use the same register when passing fn parameters
        init_pic(port->processor);
        if ((unsigned)shareBankAddress > getMaxRam())
index 44b0c50079539549d84087a51f31dd874f4dafd1..18ab6fd518064231b6238e4e87f110b9051c4cdf 100644 (file)
@@ -970,6 +970,11 @@ typeRegWithIdx (int idx, int type, int fixed)
                        debugLog ("Found a Stack Register!\n");
                        return dReg;
                }
+               else {
+                 werror (E_STACK_OUT, "Register");
+                  /* return an existing register just to avoid the SDCC crash */
+                 return regWithIdx ( dynStackRegs, 0x7f, fixed);
+                }
                break;
        case REG_SFR:
                if( (dReg = regWithIdx ( dynProcessorRegs, idx, fixed)) != NULL ) {