fix overlapping sloc problem
[fw/sdcc] / src / ds390 / ralloc.c
index 55b2e22282412b9c398c52e94b8f1a4604e673a4..3fab7c2dc497c4f3e161e0c9d050642ee650a617 100644 (file)
@@ -380,13 +380,11 @@ noOverLap (set * itmpStack, symbol * fsym)
 {
   symbol *sym;
 
-
   for (sym = setFirstItem (itmpStack); sym;
        sym = setNextItem (itmpStack))
     {
-      if (sym->liveTo > fsym->liveFrom)
+      if (sym->liveTo >= fsym->liveFrom)
        return 0;
-
     }
 
   return 1;
@@ -2210,7 +2208,10 @@ packForPush (iCode * ic, eBBlock * ebp)
   for (lic = ic; lic != dic ; lic = lic->prev) {
          if (bitVectBitValue(dbv,lic->key)) return ;
   }
-
+  /* extend the live range of replaced operand if needed */
+  if (OP_SYMBOL(IC_RIGHT(dic))->liveTo < ic->seq) {
+         OP_SYMBOL(IC_RIGHT(dic))->liveTo = ic->seq;
+  }
   /* we now we know that it has one & only one def & use
      and the that the definition is an assignment */
   IC_LEFT (ic) = IC_RIGHT (dic);