* src/avr/ralloc.c (serialRegAssign),
[fw/sdcc] / src / hc08 / ralloc.c
index 175f83dd3c698b25054632a10973bbf9b300bc37..97a6cdafbb8caa16ec4cac53daa3ac7451a5c2b7 100644 (file)
@@ -1265,7 +1265,13 @@ serialRegAssign (eBBlock ** ebbs, int count)
                int j;
                int ptrRegSet = 0;
 
-               /* 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 ||