mirror of
https://github.com/cc65/cc65.git
synced 2025-02-05 04:37:23 +00:00
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
This commit is contained in:
parent
8c8e0b131f
commit
df341b6551
@ -406,17 +406,12 @@ unsigned OptJumpCascades (CodeSeg* S)
|
|||||||
/* Remember, we had changes */
|
/* Remember, we had changes */
|
||||||
++Changes;
|
++Changes;
|
||||||
|
|
||||||
/* Done */
|
|
||||||
continue;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if both are conditional branches, and the condition of
|
/* 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 is the inverse of that of the first. In this case,
|
||||||
* the second branch will never be taken, and we may jump directly
|
* the second branch will never be taken, and we may jump directly
|
||||||
* to the instruction behind this one.
|
* 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 */
|
CodeEntry* X; /* Instruction behind N */
|
||||||
CodeLabel* LX; /* Label attached to X */
|
CodeLabel* LX; /* Label attached to X */
|
||||||
@ -447,10 +442,6 @@ unsigned OptJumpCascades (CodeSeg* S)
|
|||||||
|
|
||||||
/* Remember, we had changes */
|
/* Remember, we had changes */
|
||||||
++Changes;
|
++Changes;
|
||||||
|
|
||||||
/* Done */
|
|
||||||
continue;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user