From d803875b3b333ba0a54097422dfb7b0ce0acda13 Mon Sep 17 00:00:00 2001 From: sandeep Date: Thu, 21 Feb 2002 18:35:13 +0000 Subject: [PATCH] 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 --- src/SDCCloop.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.39.5