]> git.gag.com Git - fw/sdcc/commitdiff
Let's adjust instead of a boldy decrement
authorjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 8 Mar 2001 13:51:53 +0000 (13:51 +0000)
committerjohanknol <johanknol@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 8 Mar 2001 13:51:53 +0000 (13:51 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@675 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/ds390/gen.c

index c1a456725bbdc05064ffb00e389dc1a134860775..59a9670328dc2a49799889778450be500a006044 100644 (file)
@@ -1268,23 +1268,22 @@ aopPut (asmop * aop, char *s, int offset)
 }
 
 
-/*-----------------------------------------------------------------*/
-/* reAdjustPreg - points a register back to where it should        */
-/*-----------------------------------------------------------------*/
+/*--------------------------------------------------------------------*/
+/* reAdjustPreg - points a register back to where it should (coff==0) */
+/*--------------------------------------------------------------------*/
 static void
 reAdjustPreg (asmop * aop)
 {
-  int size;
-
-  aop->coff = 0;
-  if ((size = aop->size) <= 1)
+  emitcode (";jwk","reAdjustPreg: %d", aop->coff);
+  if ((aop->coff==0) || (aop->size <= 1)) {
     return;
-  size--;
+  }
+
   switch (aop->type)
     {
     case AOP_R0:
     case AOP_R1:
-      while (size--)
+      while (aop->coff--)
        emitcode ("dec", "%s", aop->aopu.aop_ptr->name);
       break;
     case AOP_DPTR:
@@ -1294,7 +1293,7 @@ reAdjustPreg (asmop * aop)
          genSetDPTR (1);
          _flushLazyDPS ();
        }
-      while (size--)
+      while (aop->coff--)
        {
          emitcode ("lcall", "__decdptr");
        }
@@ -1306,7 +1305,7 @@ reAdjustPreg (asmop * aop)
       break;
 
     }
-
+  aop->coff=0;
 }
 
 #define AOP(op) op->aop