Fixed problem where slocs can be shared by two operands, in which case
[fw/sdcc] / src / z80 / gen.c
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;
     }