From: sandeep Date: Thu, 21 Feb 2002 18:35:13 +0000 (+0000) Subject: Previous fix was not good. basic blocks that have "break" or "return" are X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d803875b3b333ba0a54097422dfb7b0ce0acda13;p=fw%2Fsdcc Previous fix was not good. basic blocks that have "break" or "return" are 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 --- diff --git a/src/SDCCloop.c b/src/SDCCloop.c index d65d40c7..238cf250 100644 --- a/src/SDCCloop.c +++ b/src/SDCCloop.c @@ -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;