Previous fix was BADDD . this should do it
[fw/sdcc] / src / mcs51 / gen.c
index 29d1711565a8d20a59fc955718ad481a8ae58c47..6ea17c482f7864b701db871d101b18b5d35e52b4 100644 (file)
@@ -554,7 +554,7 @@ aopOp (operand * op, iCode * ic, bool result)
     }
 
   /* if already has a asmop then continue */
-  if (op->aop && aop->size == getSize(sym->type))
+  if (op->aop )
     return;
 
   /* if the underlying symbol has a aop */
@@ -626,6 +626,10 @@ aopOp (operand * op, iCode * ic, bool result)
        }
 
       /* else spill location  */
+      if (sym->usl.spillLoc && getSize(sym->type) != getSize(sym->usl.spillLoc->type)) {
+         /* force a new aop if sizes differ */
+         sym->usl.spillLoc->aop = NULL;
+      }
       sym->aop = op->aop = aop =
        aopForSym (ic, sym->usl.spillLoc, result);
       aop->size = getSize (sym->type);