*** empty log message ***
[fw/sdcc] / src / SDCClrange.c
index b200b578424f6117da9f2608b46fcfba20a7bd57..7d5646cd452abb78dca96109a73b5eb72cc329d1 100644 (file)
@@ -280,7 +280,9 @@ useDefLoopCheck (operand * op, iCode * ic)
                  OP_SYMBOL (op)->name,
                  ic->filename, ic->lineno);
        }
+#if 0 // this will create a segfault: bug #498971
       OP_SYMBOL (op)->isspilt = 1;
+#endif
     }
 }
 
@@ -311,7 +313,7 @@ operandLUse (operand * op, eBBlock ** ebbs,
              if (lic->op == CALL || lic->op == PCALL) break;
          }
          /* found it : mark */
-         if (lic) torange = lic->seq;
+         if (lic) torange = lic->prev->seq;
       }
       /* if this is the last use then if this block belongs 
          to a  loop &  some definition  comes into the loop 
@@ -578,10 +580,13 @@ rlivePoint (eBBlock ** ebbs, int count)
                /* if it is live then add the lrange to ic->rlive */
                if (lrange->liveFrom <= ic->seq &&
                    lrange->liveTo >= ic->seq) {
-                   lrange->isLiveFcall |= (ic->op == CALL || ic->op == PCALL || ic->op == SEND);
+                   lrange->isLiveFcall |= ((lrange->liveFrom < ic->seq) && 
+                                           (ic->op == CALL || ic->op == PCALL || ic->op == SEND));
+                   if (ic->op == CALL && lrange->liveFrom == ic->seq) continue;
                    ic->rlive = bitVectSetBit (ic->rlive, lrange->key);
                }
            }
+#if 0
            /* overlapping live ranges should be eliminated */
            if (ASSIGN_ITEMP_TO_ITEMP (ic)) {
                if (SPIL_LOC(IC_RIGHT(ic)) == SPIL_LOC(IC_RESULT(ic))   && /* left & right share the same spil location */
@@ -592,6 +597,7 @@ rlivePoint (eBBlock ** ebbs, int count)
                    SPIL_LOC(IC_RIGHT(ic)) = NULL; /* then cannot share */
                }
            }
+#endif
        }
     }
 }