1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-26 17:36:57 +00:00

Disabling too-aggressive optimization in OptCmp8

Generates incorrect code for some 16-bit cases. See: #895
This commit is contained in:
bbbradsmith 2019-05-14 22:47:18 -04:00 committed by Oliver Schmidt
parent 448aa35f50
commit 3a3107b244

View File

@ -885,11 +885,16 @@ unsigned OptCmp8 (CodeSeg* S)
++Changes;
}
/* If we have made changes above, we may also remove the compare */
if (JumpsChanged) {
CS_DelEntry (S, I);
}
/* "If we have made changes above, we may also remove the compare."
**
** Removing the compare was too aggressive. E.g. for 16-bit compares the compiler
** may generate a branch to a second shared branch that still requires the flag
** result of the first compare instruction.
**
**if (JumpsChanged) {
** CS_DelEntry (S, I);
**}
*/
}
NextEntry: