Fixed problem where slocs can be shared by two operands, in which case
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 25 Nov 2001 23:24:55 +0000 (23:24 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 25 Nov 2001 23:24:55 +0000 (23:24 +0000)
then should go to different aops if the sizes differ

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

src/avr/gen.c
src/mcs51/gen.c
src/pic/gen.c
src/z80/gen.c

index 7a453019833be0c989be7794495af7eaa1f473ca..c2cb6e27e497ddea38e4c7c2db7a3027c16bd2f5 100644 (file)
@@ -724,7 +724,7 @@ aopOp (operand * op, iCode * ic, bool result)
        }
 
        /* if already has a asmop then continue */
-       if (op->aop)
+       if (op->aop && aop->size == getSize(sym->type))
                return;
 
        /* if the underlying symbol has a aop */
index 26ffca96098a23ace98bfdecba87f9d0a797d3a7..29d1711565a8d20a59fc955718ad481a8ae58c47 100644 (file)
@@ -554,7 +554,7 @@ aopOp (operand * op, iCode * ic, bool result)
     }
 
   /* if already has a asmop then continue */
-  if (op->aop)
+  if (op->aop && aop->size == getSize(sym->type))
     return;
 
   /* if the underlying symbol has a aop */
index afc8beb38496c320ab3613bd8cedf6d0490d0b5d..981eec6e7ed576a5cc31fb29a6ac0a940f48dff6 100644 (file)
@@ -710,7 +710,7 @@ void aopOp (operand *op, iCode *ic, bool result)
     }
 
     /* if already has a asmop then continue */
-    if (op->aop)
+    if (op->aop && aop->size == getSize(sym->type))
         return ;
 
     /* if the underlying symbol has a aop */
index ee1ddaad71e88253258135f64ec117fb261f6337..2892942d969b68c37dd930b32cd3d02cb810525a 100644 (file)
@@ -825,7 +825,7 @@ aopOp (operand * op, iCode * ic, bool result, bool requires_a)
     }
 
   /* if already has a asmop then continue */
-  if (op->aop)
+  if (op->aop && aop->size == getSize(sym->type))
     {
       return;
     }
@@ -924,8 +924,6 @@ aopOp (operand * op, iCode * ic, bool result, bool requires_a)
        aopForSym (ic, sym->usl.spillLoc, result, requires_a);
       wassertl (aop->size >= getSize (sym->type), "Operand doesn't fit in the spill location");
       aop->size = getSize (sym->type);
-      /* PENDING: HACK.  Can have different sizes in the same AOP. */
-      sym->usl.spillLoc->aop = NULL;
       return;
     }