]> git.gag.com Git - fw/sdcc/commitdiff
* src/hc08/gen.h,
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 12 Feb 2004 07:37:22 +0000 (07:37 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 12 Feb 2004 07:37:22 +0000 (07:37 +0000)
* src/hc08/gen.c (storeRegToAop, aopOp, aopAdrStr, accopWithAop,
rmwWithAop): Ported my 2004-10-02 fix for bug #663539 to the hc08,
thus fixing bug #895406

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

ChangeLog
src/hc08/gen.c
src/hc08/gen.h

index 1c8a3a10e323ed871fb601f877257c60f114f955..6968afa7584b439cfdbe1ad27e0c940052d34889 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2004-02-12 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/hc08/gen.h,
+       * src/hc08/gen.c (storeRegToAop, aopOp, aopAdrStr, accopWithAop,
+       rmwWithAop): Ported my 2004-10-02 fix for bug #663539 to the hc08,
+       thus fixing bug #895406
+
 2004-02-11 Bernhard Held <bernhard AT bernhardheld.de>
 
        * device/lib/_modsint.c,
index 97748e372cf15a0706d62893e6d7b790f3e18d22..b515ed79b6d035f4dbf165c3e058aa478265407f 100644 (file)
@@ -762,7 +762,10 @@ storeRegToAop (regs *reg, asmop *aop, int loffset)
       return;
     }
 
-    switch (regidx)
+  if (aop->type == AOP_DUMMY)
+    return;
+    
+  switch (regidx)
     {
       case A_IDX:
         if ((aop->type == AOP_REG) && (loffset < aop->size))
@@ -945,6 +948,8 @@ storeConstToAop (char *c, asmop *aop, int loffset)
           break;
         loadRegFromConst (aop->aopu.aop_reg[loffset], c);
         break;
+      case AOP_DUMMY:
+        break;
       default:
         if (hc08_reg_a->isFree)
           {
@@ -1155,7 +1160,10 @@ accopWithAop (char *accop, asmop *aop, int loffset)
       accopWithAop (accop, aop->stk_aop[loffset], 0);
       return;
     }
-    
+
+  if (aop->type == AOP_DUMMY)
+    return;
+
   if (aop->type == AOP_REG)
     {
       pushReg (aop->aopu.aop_reg[loffset], FALSE);
@@ -1238,6 +1246,8 @@ rmwWithAop (char *rmwop, asmop *aop, int loffset)
        storeRegToAop (hc08_reg_a, aop, loffset);
         pullOrFreeReg (hc08_reg_a, needpula);
         break;
+      case AOP_DUMMY:
+        break;
       default:
         emitcode (rmwop, "%s", aopAdrStr (aop, loffset, FALSE));
    }
@@ -1689,27 +1699,27 @@ aopOp (operand * op, iCode * ic, bool result)
        }
 #endif
       /* else spill location  */
-//      printf("checking spill loc\n");
-//      if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) {
-      if (sym->usl.spillLoc && sym->usl.spillLoc->aop
-          && sym->usl.spillLoc->aop->size != getSize (sym->type))
+      if (sym->usl.spillLoc)
         {
-         /* force a new aop if sizes differ */
-         sym->usl.spillLoc->aop = NULL;
-         //printf ("forcing new aop\n");
-        }
-      sym->aop = op->aop = aop =
-       aopForSym (ic, sym->usl.spillLoc, result);
+          if (sym->usl.spillLoc->aop
+              && sym->usl.spillLoc->aop->size != getSize (sym->type))
+            {
+             /* force a new aop if sizes differ */
+             sym->usl.spillLoc->aop = NULL;
+             //printf ("forcing new aop\n");
+            }
+         sym->aop = op->aop = aop = aopForSym (ic, sym->usl.spillLoc, result);
+         aop->size = getSize (sym->type);
+         aop->op = op;
+         aop->isaddr = op->isaddr;
+         //printf ("spill symbol %s\n", OP_SYMBOL (op)->name);
+         //printf (" with size = %d\n", aop->size);
+         return;
+       }
+      
+      /* else must be a dummy iTemp */
+      sym->aop = op->aop = aop = newAsmop (AOP_DUMMY);
       aop->size = getSize (sym->type);
-      aop->op = op;
-      aop->isaddr = op->isaddr;
-      //printf ("spill symbol %s\n", OP_SYMBOL (op)->name);
-      //printf (" with size = %d\n", aop->size);
-      /* if (aop->isaddr & IS_ITEMP (op))
-        {
-          aop->psize=aop->size;
-          aop->size = getSize( operandType (op)->next);
-        } */
       return;
     }
 
@@ -1871,6 +1881,9 @@ aopAdrStr (asmop * aop, int loffset, bool bit16)
   switch (aop->type)
     {
 
+    case AOP_DUMMY:
+      return zero;
+      
     case AOP_IMMD:
       if (aop->aopu.aop_immd.from_cast_remat && (loffset == (aop->size-1))) {
              sprintf(s,"%s",aop->aopu.aop_immd.aop_immd2);
@@ -3427,7 +3440,7 @@ genMultOneByte (operand * left,
                operand * right,
                operand * result)
 {
-  sym_link *opetype = operandType (result);
+  /* sym_link *opetype = operandType (result); */
   symbol *tlbl1, *tlbl2, *tlbl3, *tlbl4;
   int size=AOP_SIZE(result);
   bool negLiteral = FALSE;
index fd9ae77a11b8c6e3b7ee3ca2d33b129efb236461..f1463a58f24338ed8d50d0b0671c82b37fd83069 100644 (file)
@@ -31,7 +31,7 @@ enum
     AOP_REG, AOP_DIR,
     AOP_STK, AOP_IMMD, AOP_STR,
     AOP_CRY, 
-    AOP_EXT, AOP_SOF,
+    AOP_EXT, AOP_SOF, AOP_DUMMY
   };
 
 enum