mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 22:25:28 +00:00
Fixed a bug
git-svn-id: svn://svn.cc65.org/cc65/trunk@1242 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -500,8 +500,13 @@ unsigned OptJumpTarget (CodeSeg* S)
|
|||||||
/* Get next entry */
|
/* Get next entry */
|
||||||
E2 = CS_GetNextEntry (S, I);
|
E2 = CS_GetNextEntry (S, I);
|
||||||
|
|
||||||
/* Check if we have a jump or branch, and a matching label */
|
/* Check if we have a jump or branch, and a matching label, which
|
||||||
if (E2 && (E2->Info & OF_UBRA) != 0 && E2->JumpTo) {
|
* is not attached to the jump itself
|
||||||
|
*/
|
||||||
|
if (E2 != 0 &&
|
||||||
|
(E2->Info & OF_UBRA) != 0 &&
|
||||||
|
E2->JumpTo &&
|
||||||
|
E2->JumpTo->Owner != E2) {
|
||||||
|
|
||||||
/* Get the entry preceeding the branch target */
|
/* Get the entry preceeding the branch target */
|
||||||
T1 = CS_GetPrevEntry (S, CS_GetEntryIndex (S, E2->JumpTo->Owner));
|
T1 = CS_GetPrevEntry (S, CS_GetEntryIndex (S, E2->JumpTo->Owner));
|
||||||
@@ -908,7 +913,7 @@ unsigned OptDupLoads (CodeSeg* S)
|
|||||||
if (In->RegA >= 0 &&
|
if (In->RegA >= 0 &&
|
||||||
In->RegA == In->RegX &&
|
In->RegA == In->RegX &&
|
||||||
(N = CS_GetNextEntry (S, I)) != 0 &&
|
(N = CS_GetNextEntry (S, I)) != 0 &&
|
||||||
!CE_UseLoadFlags (N)) {
|
!CE_UseLoadFlags (N)) {
|
||||||
/* Value is identical and not followed by a branch */
|
/* Value is identical and not followed by a branch */
|
||||||
Delete = 1;
|
Delete = 1;
|
||||||
}
|
}
|
||||||
@@ -967,7 +972,7 @@ unsigned OptDupLoads (CodeSeg* S)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Free register info */
|
/* Free register info */
|
||||||
CS_FreeRegInfo (S);
|
CS_FreeRegInfo (S);
|
||||||
|
|
||||||
/* Return the number of changes made */
|
/* Return the number of changes made */
|
||||||
@@ -1060,7 +1065,7 @@ unsigned OptTransfers (CodeSeg* S)
|
|||||||
*/
|
*/
|
||||||
if ((X = CS_GetNextEntry (S, I+1)) == 0) {
|
if ((X = CS_GetNextEntry (S, I+1)) == 0) {
|
||||||
goto NextEntry;
|
goto NextEntry;
|
||||||
}
|
}
|
||||||
if (CE_UseLoadFlags (X)) {
|
if (CE_UseLoadFlags (X)) {
|
||||||
if (I == 0) {
|
if (I == 0) {
|
||||||
/* No preceeding entry */
|
/* No preceeding entry */
|
||||||
|
Reference in New Issue
Block a user