From 2f4825ff2c16c755a316febe687b3d43aa57b482 Mon Sep 17 00:00:00 2001 From: sandeep Date: Sat, 27 Oct 2001 20:38:15 +0000 Subject: [PATCH] Fix for bug 474411: Two loops can share the same lastBlock so the 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 | 4 ++++ src/SDCCloop.c | 2 +- src/SDCClrange.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SDCCBBlock.c b/src/SDCCBBlock.c index 4e56f141..eeebbd4c 100644 --- a/src/SDCCBBlock.c +++ b/src/SDCCBBlock.c @@ -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); } diff --git a/src/SDCCloop.c b/src/SDCCloop.c index 7ab87a7f..beb7bd56 100644 --- a/src/SDCCloop.c +++ b/src/SDCCloop.c @@ -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); diff --git a/src/SDCClrange.c b/src/SDCClrange.c index 53c35806..75242d19 100644 --- a/src/SDCClrange.c +++ b/src/SDCClrange.c @@ -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); } -- 2.30.2