* src/mcs51/ralloc.c (deassignLR),
[fw/sdcc] / src / mcs51 / ralloc.c
index ffa28c056bd95fc117ada6db7644503977f0b476..ec01a64642e23b935a55a847a41fa9527828b4a5 100644 (file)
@@ -981,6 +981,7 @@ deassignLRs (iCode * ic, eBBlock * ebp)
              (result = OP_SYMBOL (IC_RESULT (ic))) &&  /* has a result */
              result->liveTo > ic->seq &&       /* and will live beyond this */
              result->liveTo <= ebp->lSeq &&    /* does not go beyond this block */
+             result->liveFrom == ic->seq &&    /* does not start before here */
              result->regType == sym->regType &&        /* same register types */
              result->nRegs &&  /* which needs registers */
              !result->isspilt &&       /* and does not already have them */
@@ -1409,7 +1410,7 @@ static void fillGaps()
                bitVectBitValue(_G.totRegAssigned,i) == 0) /* and are still assigned to registers */
                continue ;
 
-               clr = hTabItemWithKey(liveRanges,i);
+           clr = hTabItemWithKey(liveRanges,i);
            assert(clr);
 
            /* mark these registers as used */