Previous fix was not good. basic blocks that have "break" or "return" are
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 21 Feb 2002 18:35:13 +0000 (18:35 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 21 Feb 2002 18:35:13 +0000 (18:35 +0000)
not really partof a loop , but live ranges used in these blocks should
be live thru the entire loop, so set partOfLoop but don't add them to
loop region

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

src/SDCCloop.c

index d65d40c78af651e8c12e2766201d18d09120bba6..238cf250b3915e0e439792f4dc8c3b93d332bfc2 100644 (file)
@@ -292,10 +292,13 @@ DEFSETFUNC (createLoop)
   /* all blocks that have dfnumbers between dfMin & dfMax are also
      part of loop */
   for (i = 0 ; i < count ; i++) {
-      if (ebbs[i]->dfnum > dfMin && ebbs[i]->dfnum < dfMax) {
-             loopInsert(&aloop->regBlocks,ebbs[i]);
+      if (ebbs[i]->dfnum > dfMin && 
+         ebbs[i]->dfnum < dfMax &&
+         !isinSet(aloop->regBlocks,ebbs[i])) {
+         if (!ebbs[i]->partOfLoop) ebbs[i]->partOfLoop = aloop;
       }
   }
+
   /* now add it to the set */
   addSetHead (allRegion, aloop);
   return 0;