From: uz Date: Mon, 12 Jan 2009 19:48:28 +0000 (+0000) Subject: Fixed an optimizer problem: A branch into a list of at least two branches X-Git-Tag: V2.13.0rc1~348 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=df341b65516fc949a82e6cd2a1c9b4970e82029d;p=cc65 Fixed an optimizer problem: A branch into a list of at least two branches pointing to themselves caused the optimizer to loop forever. git-svn-id: svn://svn.cc65.org/cc65/trunk@3907 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c index 332ec1370..67fa1f7e5 100644 --- a/src/cc65/coptind.c +++ b/src/cc65/coptind.c @@ -406,17 +406,12 @@ unsigned OptJumpCascades (CodeSeg* S) /* Remember, we had changes */ ++Changes; - /* Done */ - continue; - - } - /* Check if both are conditional branches, and the condition of * the second is the inverse of that of the first. In this case, * the second branch will never be taken, and we may jump directly * to the instruction behind this one. */ - if ((E->Info & OF_CBRA) != 0 && (N->Info & OF_CBRA) != 0) { + } else if ((E->Info & OF_CBRA) != 0 && (N->Info & OF_CBRA) != 0) { CodeEntry* X; /* Instruction behind N */ CodeLabel* LX; /* Label attached to X */ @@ -447,10 +442,6 @@ unsigned OptJumpCascades (CodeSeg* S) /* Remember, we had changes */ ++Changes; - - /* Done */ - continue; - } }