From: johanknol Date: Tue, 23 Oct 2001 12:40:19 +0000 (+0000) Subject: fixed bug #443366 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=74d7034386679789c3e835c2d104941fd6c759d3;p=fw%2Fsdcc fixed bug #443366 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1436 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCast.c b/src/SDCCast.c index 9beec54f..4572ac76 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -3565,8 +3565,12 @@ createIf (ast * condAst, ast * ifBody, ast * elseBody) symbol *ifTrue, *ifFalse, *ifEnd; /* if neither exists */ - if (!elseBody && !ifBody) - return condAst; + if (!elseBody && !ifBody) { + // if there are no side effects (i++, j() etc) + if (!hasSEFcalls(condAst)) { + return condAst; + } + } /* create the labels */ sprintf (buffer, "_iffalse_%d", Lblnum);