Previous fix was BADDD . this should do it
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 26 Nov 2001 00:57:16 +0000 (00:57 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 26 Nov 2001 00:57:16 +0000 (00:57 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1647 4a8a32a2-be11-0410-ad9d-d568d2c75423

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

index c2cb6e27e497ddea38e4c7c2db7a3027c16bd2f5..638182ab0d4e9eeb6c279864df83d729d03b8777 100644 (file)
@@ -724,7 +724,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 */
@@ -783,6 +783,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);
index ff42baaae1c7d3781a7d07d8c21fbfd3da8cc7e1..cc4aab1148a008d3205fd0a60a5c533f835d0839 100644 (file)
@@ -746,7 +746,7 @@ aopOp (operand * op, iCode * ic, bool result, bool useDP2)
     }
 
   /* 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 */
@@ -827,6 +827,10 @@ aopOp (operand * op, iCode * ic, bool result, bool useDP2)
        }
 
       /* 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, useDP2);
       aop->size = getSize (sym->type);
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);
index 981eec6e7ed576a5cc31fb29a6ac0a940f48dff6..19197447f45caff3e43d9342c92966e8cd16a82e 100644 (file)
@@ -710,7 +710,7 @@ void 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 */
@@ -780,6 +780,10 @@ void 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;
+       }
        DEBUGpic14_emitcode(";","%s %d %s",__FUNCTION__,__LINE__,sym->usl.spillLoc->rname);
         sym->aop = op->aop = aop = 
                                   aopForSym(ic,sym->usl.spillLoc,result);
index 2892942d969b68c37dd930b32cd3d02cb810525a..0f9a24c49f9897e8376e45f14489d742f088dfac 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 && aop->size == getSize(sym->type))
+  if (op->aop)
     {
       return;
     }
@@ -920,6 +920,10 @@ aopOp (operand * op, iCode * ic, bool result, bool requires_a)
        }
 
       /* 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;
+      }
       op->aop = aop =
        aopForSym (ic, sym->usl.spillLoc, result, requires_a);
       wassertl (aop->size >= getSize (sym->type), "Operand doesn't fit in the spill location");