* src/avr/ralloc.c (serialRegAssign),
[fw/sdcc] / src / ds390 / ralloc.c
index afede94d6af3cf9bbbc42b332d629b188844ea3c..618c16516e75d82156e9e5b6bd22091f5958eb65 100644 (file)
@@ -1332,6 +1332,17 @@ serialRegAssign (eBBlock ** ebbs, int count)
 
                }
 
+             /* If the live range preceeds the point of definition 
+                then ideally we must take into account registers that 
+                have been allocated after sym->liveFrom but freed
+                before ic->seq. This is complicated, so spill this
+                symbol instead and let fillGaps handle the allocation. */
+             if (sym->liveFrom < ic->seq)
+               {
+                   spillThis (sym);
+                   continue;                 
+               }
+
              /* if it has a spillocation & is used less than
                 all other live ranges then spill this */
                if (willCS) {