* src/mcs51/ralloc.c (getRegPtr, getRegGpr),
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 30 Jan 2004 05:52:20 +0000 (05:52 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 30 Jan 2004 05:52:20 +0000 (05:52 +0000)
* src/ds390/ralloc.c (getRegPtr, getRegGpr),
* src/pic/ralloc.c (getRegPtr, getRegGpr),
* src/pic16/ralloc.c (getRegPtr, getRegGpr),
* src/z80/ralloc.c (getRegGpr): fixed bug #883361
* as/mcs51/asexpr.c (term),
* as/hc08/asexpr.c (term): fixed bug #887146

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

ChangeLog
as/hc08/asexpr.c
as/mcs51/asexpr.c
src/ds390/ralloc.c
src/mcs51/ralloc.c
src/pic/ralloc.c
src/pic16/ralloc.c
src/z80/ralloc.c

index b3453cdc1e55f82e23d5513ae33659f199d539f3..08d834a1a9429614e5c5b9f22475cc10f9783240 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
-2004-01-27 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+2004-01-30 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/mcs51/ralloc.c (getRegPtr, getRegGpr),
+       * src/ds390/ralloc.c (getRegPtr, getRegGpr),
+       * src/pic/ralloc.c (getRegPtr, getRegGpr),
+       * src/pic16/ralloc.c (getRegPtr, getRegGpr),
+       * src/z80/ralloc.c (getRegGpr): fixed bug #883361
+       * as/mcs51/asexpr.c (term),
+       * as/hc08/asexpr.c (term): fixed bug #887146
+
+2004-01-29 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
 
        * src/z80/gen.c (genMult): handle single byte result product
        * src/SDCCopt.c (killDeadCode): never convert ADDRESS_OF iCode to
index 26aea4b0a015f474d23a3f33ae7e8533c999e942..a21e9b0feff473674417f5297f5d691d5de53d6a 100644 (file)
@@ -408,7 +408,7 @@ register struct expr *esp;
                                 }
                                 tp = tp->t_lnk;
                         }
-                        /* err('u'); */
+                        err('u');
                         return;
                 }
                 r = radix;
index 26aea4b0a015f474d23a3f33ae7e8533c999e942..a21e9b0feff473674417f5297f5d691d5de53d6a 100644 (file)
@@ -408,7 +408,7 @@ register struct expr *esp;
                                 }
                                 tp = tp->t_lnk;
                         }
-                        /* err('u'); */
+                        err('u');
                         return;
                 }
                 r = radix;
index 042eb5009109fada2b0d36957caa48e67fdedada..42de2a96aeabbd444d148714f40bd42ae4d87eb3 100644 (file)
@@ -802,6 +802,7 @@ static regs *
 getRegPtr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
 tryAgain:
   /* try for a ptr type */
@@ -816,6 +817,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
@@ -828,6 +834,7 @@ static regs *
 getRegGpr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
 tryAgain:
   /* try for gpr type */
@@ -842,6 +849,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
index 163c2c54fffca23f890f0245f8650e8a1150b6ee..e45b233caf762198fd5dfc85d2c44fcf9985a920 100644 (file)
@@ -782,6 +782,7 @@ static regs *
 getRegPtr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
 tryAgain:
   /* try for a ptr type */
@@ -796,6 +797,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
@@ -808,7 +814,8 @@ static regs *
 getRegGpr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
-
+  int j;
+  
 tryAgain:
   /* try for gpr type */
   if ((reg = allocReg (REG_GPR)))
@@ -822,6 +829,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
@@ -1208,6 +1220,17 @@ serialRegAssign (eBBlock ** ebbs, int count)
                    mcs51_ptrRegReq++;
                    ptrRegSet = 1;
                }
+               if (IC_LEFT (ic) && IS_SYMOP (IC_LEFT (ic))
+                   && SPEC_OCLS(OP_SYMBOL (IC_LEFT (ic))->etype) == idata) {
+                   mcs51_ptrRegReq++;
+                   ptrRegSet = 1;
+               }
+               if (IC_RIGHT (ic) && IS_SYMOP (IC_RIGHT (ic))
+                   && SPEC_OCLS(OP_SYMBOL (IC_RIGHT (ic))->etype) == idata) {
+                   mcs51_ptrRegReq++;
+                   ptrRegSet = 1;
+               }
+               
                /* else we assign registers to it */
                _G.regAssigned = bitVectSetBit (_G.regAssigned, sym->key);
                _G.totRegAssigned = bitVectSetBit (_G.totRegAssigned, sym->key);
index 809c6dbea5e8784d5aba93311a4be752ff12a60a..8dfd64f73c6a9345fbb718a3c9f9855331bd0feb 100644 (file)
@@ -1925,6 +1925,7 @@ static regs *
 getRegPtr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
   debugLog ("%s\n", __FUNCTION__);
 tryAgain:
@@ -1940,6 +1941,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
@@ -1952,6 +1958,7 @@ static regs *
 getRegGpr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
   debugLog ("%s\n", __FUNCTION__);
 tryAgain:
@@ -1967,6 +1974,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
index 343546c6a838a9f1b2d0b0f2bad2ca1db9ff4258..2f21d2215cb5b88ebda785d52ca8b6557e1f7a5f 100644 (file)
@@ -1734,6 +1734,7 @@ static regs *
 getRegPtr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
   debugLog ("%s\n", __FUNCTION__);
 tryAgain:
@@ -1749,6 +1750,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
@@ -1761,6 +1767,7 @@ static regs *
 getRegGpr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
   debugLog ("%s\n", __FUNCTION__);
 tryAgain:
@@ -1776,6 +1783,11 @@ tryAgain:
   if (!spilSomething (ic, ebp, sym))
     return NULL;
 
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
+      
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */
   goto tryAgain;
index a9ce2dcc7c8028aa51e9201c1e10a1b89770e555..17d3b8065db114c3af2d14143ab5272c768d18af 100644 (file)
@@ -763,6 +763,7 @@ regs *
 getRegGpr (iCode * ic, eBBlock * ebp, symbol * sym)
 {
   regs *reg;
+  int j;
 
   D (D_ALLOC, ("getRegGpr: on ic %p\n", ic));
 tryAgain:
@@ -779,6 +780,11 @@ tryAgain:
       D (D_ALLOC, ("getRegGpr: have to spill.\n"));
       return NULL;
     }
+  
+  /* make sure partially assigned registers aren't reused */
+  for (j=0; j<=sym->nRegs; j++)
+    if (sym->regs[j])
+      sym->regs[j]->isFree = 0;
 
   /* this looks like an infinite loop but 
      in really selectSpil will abort  */