* src/pic16/gen.c (genFarPointerGet,genFarPointerSet): removed
authortecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 18 Sep 2005 11:19:12 +0000 (11:19 +0000)
committertecodev <tecodev@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 18 Sep 2005 11:19:12 +0000 (11:19 +0000)
  as these are now unused,
  (genPointerGet,genPointerSet): handle FPOINTERs like POINTERs
* src/pic16/pcode.c (pic16_symIsSpecial): assume REG_TMPs to be
  local, avoids uninitialized pointer dereference on r->name
* src/pic16/ralloc.c (newReg): fixed indentation

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

ChangeLog
src/pic16/gen.c
src/pic16/pcode.c
src/pic16/ralloc.c

index 46cbbc3829c068da7b33142374071db0c76aad94..64563ccac518744792ba75aef859ff0ac1fec9e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-09-18 Raphael Neider <rneider AT web.de>
+
+       * src/pic16/gen.c (genFarPointerGet,genFarPointerSet): removed
+         as these are now unused,
+         (genPointerGet,genPointerSet): handle FPOINTERs like POINTERs
+       * src/pic16/pcode.c (pic16_symIsSpecial): assume REG_TMPs to be
+         local, avoids uninitialized pointer dereference on r->name
+       * src/pic16/ralloc.c (newReg): fixed indentation
+
 2005-09-13 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/SDCCval.c (constVal): fixed bug 730366
index 9ca5da162e096bafd4aa27b0db89616edd9d4ece..00d5cd1bd2b70aeb126b0150ca7f9ab28a7ba708 100644 (file)
@@ -10972,6 +10972,10 @@ static void genPagedPointerGet (operand *left,
        
 }
 
+#if 0
+/* This code is not adjusted to PIC16 and fails utterly.
+ * On the other hand: PIC16 does not support xdata (the only mem FPOINTERs are used for) anyway... */
+
 /*-----------------------------------------------------------------*/
 /* genFarPointerGet - gget value from far space                    */
 /*-----------------------------------------------------------------*/
@@ -11021,6 +11025,7 @@ static void genFarPointerGet (operand *left,
 
     pic16_freeAsmop(result,NULL,ic,TRUE);
 }
+#endif
 
 #if 0
 /*-----------------------------------------------------------------*/
@@ -11313,6 +11318,7 @@ static void genPointerGet (iCode *ic)
     the pointer values */
     switch (p_type) {
       case POINTER:    
+      case FPOINTER:
       case IPOINTER:
        genNearPointerGet (left,result,ic);
        break;
@@ -11321,9 +11327,13 @@ static void genPointerGet (iCode *ic)
        genPagedPointerGet(left,result,ic);
        break;
 
+#if 0
+      /* PICs do not support FAR pointers... */
+      /* MUST move them somewhere; handle FPOINTERs like POINTERS or like GPOINTERs?!? */
       case FPOINTER:
        genFarPointerGet (left,result,ic);
        break;
+#endif
 
       case CPOINTER:
        genConstPointerGet (left,result,ic);
@@ -11825,6 +11835,10 @@ static void genPagedPointerSet (operand *right,
        
 }
 
+#if 0
+/* This code is not adjusted to PIC16 and fails utterly...
+ * On the other hand: PIC16 has no xdata anyway (the only memory FPOINTERs are use for) */
+
 /*-----------------------------------------------------------------*/
 /* genFarPointerSet - set value from far space                     */
 /*-----------------------------------------------------------------*/
@@ -11874,6 +11888,7 @@ static void genFarPointerSet (operand *right,
 
     pic16_freeAsmop(right,NULL,ic,TRUE);
 }
+#endif
 
 /*-----------------------------------------------------------------*/
 /* genGenPointerSet - set value from generic pointer space         */
@@ -12102,6 +12117,7 @@ static void genPointerSet (iCode *ic)
     the pointer values */
     switch (p_type) {
       case POINTER:
+      case FPOINTER:
       case IPOINTER:
         genNearPointerSet (right,result,ic);
         break;
@@ -12110,9 +12126,12 @@ static void genPointerSet (iCode *ic)
         genPagedPointerSet (right,result,ic);
        break;
 
+#if 0
+      /* MUST move them somewhere; handle FPOINTERs like POINTERS or like GPOINTERs?!? */
       case FPOINTER:
         genFarPointerSet (right,result,ic);
         break;
+#endif
         
       case GPOINTER:
         genGenPointerSet (right,result,ic);
index 24f36331f42431c48fb1eff291f42557c80236bf..6e12de99617495f6f87367b3759a69dadfee9ecd 100644 (file)
@@ -10578,6 +10578,8 @@ static int pic16_symIsSpecial (symbol_t sym) {
 static int pic16_regIsLocal (regs *r) {
   symbol_t sym;
   if (r) {
+    if (r->type == REG_TMP) return 1;
+
     sym = symFromStr (r->name);
     switch (sym) {
     case SPO_WREG:
index 5fa12896432b93910d0a3eac2bcd074ac268af39..197cf0138bbcd31393301d3fa0f38ab77bdeaca0 100644 (file)
@@ -371,9 +371,10 @@ regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alia
                dReg->name = Safe_strdup(name);
        else {
                sprintf(buffer,"r0x%02X", dReg->rIdx);
-               if(type == REG_STK)
+               if(type == REG_STK) {
                        *buffer = 's';
-                       dReg->name = Safe_strdup(buffer);
+               }
+               dReg->name = Safe_strdup(buffer);
        }
 
 
@@ -392,7 +393,7 @@ regs* newReg(short type, short pc_type, int rIdx, char *name, int size, int alia
        }
 
 #if NEWREG_DEBUG
-       fprintf(stderr,"newReg: %s, rIdx = 0x%02x\taccess= %d\tregop= %p\n",dReg->name,rIdx, dReg->accessBank, refop);
+       fprintf(stderr,"newReg @ %p: %s, rIdx = 0x%02x\taccess= %d\tregop= %p\n",dReg, dReg->name,rIdx, dReg->accessBank, refop);
 #endif
        dReg->size = size;
        dReg->alias = alias;