Fix for bug 474411: Two loops can share the same lastBlock so the
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 27 Oct 2001 20:38:15 +0000 (20:38 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 27 Oct 2001 20:38:15 +0000 (20:38 +0000)
induction variables should be unioned.

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1455 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCBBlock.c
src/SDCCloop.c
src/SDCClrange.c

index 4e56f141a62e38a0fcad64348f575e9c87d4d7bf..eeebbd4ce8edb74534bcf2edb9e7c574f14488e0 100644 (file)
@@ -196,6 +196,10 @@ dumpEbbsToFileExt (int id, eBBlock ** ebbs, int count)
       bitVectDebugOn (ebbs[i]->ldefs, of);
       fprintf (of, "\npointers Set bitvector :");
       bitVectDebugOn (ebbs[i]->ptrsSet, of);
+      if (ebbs[i]->isLastInLoop) {
+             fprintf (of, "\nInductions Set bitvector :");
+             bitVectDebugOn (ebbs[i]->linds, of);
+      }
       fprintf (of, "\n----------------------------------------------------------------\n");
       printiCChain (ebbs[i]->sch, of);
     }
index 7ab87a7ff8277d62140a6b17be62365b2b250715..beb7bd56d64940556ff542a704c56e15e5c188d5 100644 (file)
@@ -1044,7 +1044,7 @@ loopInduction (region * loopReg, eBBlock ** ebbs, int count)
       /* add the induction variable vector to the last
          block in the loop */
       lastBlock->isLastInLoop = 1;
-      lastBlock->linds = indVect;
+      lastBlock->linds = bitVectUnion(lastBlock->linds,indVect);
     }
 
   setToNull ((void **) &indVars);
index 53c3580619af070963a279f16d91a662cc361c03..75242d192e6a1ca0b0c54a5cb09d65509ec7b6f3 100644 (file)
@@ -304,7 +304,7 @@ operandLUse (operand * op, eBBlock ** ebbs,
          to a  loop &  some definition  comes into the loop 
          then extend the live range to  the end of the loop */
       if (ebp->partOfLoop 
-         /* && hasIncomingDefs (ebp->partOfLoop, op)*/ )
+         && hasIncomingDefs (ebp->partOfLoop, op))
        {
          torange = findLoopEndSeq (ebp->partOfLoop);
        }