* src/avr/ralloc.c (serialRegAssign),
[fw/sdcc] / src / xa51 / ralloc.c
index 364895bdc6fd87f2489d0e3d447dc37a3414ce36..e53ea595c02c987a99c39502c29283de222a8549 100755 (executable)
@@ -985,7 +985,13 @@ serialRegAssign (eBBlock ** ebbs, int count)
        bitVect *spillable;
        int willCS;
        
-       /* if it does not need or is spilt 
+       /* Make sure any spill location is definately allocated */
+       if (sym->isspilt && !sym->remat && sym->usl.spillLoc &&
+           !sym->usl.spillLoc->allocreq) {
+         sym->usl.spillLoc->allocreq++;
+       }
+       
+        /* if it does not need or is spilt 
           or is already assigned to registers
           or will not live beyond this instructions */
        if (!sym->nRegs ||