From b75bdc65d37c2e2923ea1c7f0624af21da89988e Mon Sep 17 00:00:00 2001 From: uz Date: Thu, 1 Oct 2009 21:53:55 +0000 Subject: [PATCH] Fixed problems that were introduced with r4287. git-svn-id: svn://svn.cc65.org/cc65/trunk@4298 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/coptind.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cc65/coptind.c b/src/cc65/coptind.c index 4bd65eea8..81037b6fa 100644 --- a/src/cc65/coptind.c +++ b/src/cc65/coptind.c @@ -1643,11 +1643,11 @@ unsigned OptTransfers3 (CodeSeg* S) /* If we have a replacement store, change the code */ if (X) { - /* Insert before the xfer insn */ - CS_InsertEntry (S, X, Xfer); + /* Insert after the xfer insn */ + CS_InsertEntry (S, X, Xfer+1); /* Remove the xfer instead */ - CS_DelEntry (S, Xfer+1); + CS_DelEntry (S, Xfer); /* Remove the final store */ CS_DelEntry (S, Store); @@ -1801,11 +1801,11 @@ unsigned OptTransfers4 (CodeSeg* S) /* If we have a replacement load, change the code */ if (X) { - /* Insert before the xfer insn */ - CS_InsertEntry (S, X, Xfer); + /* Insert after the xfer insn */ + CS_InsertEntry (S, X, Xfer+1); /* Remove the xfer instead */ - CS_DelEntry (S, Xfer+1); + CS_DelEntry (S, Xfer); /* Remove the initial load */ CS_DelEntry (S, Load); @@ -1917,12 +1917,12 @@ unsigned OptPushPop (CodeSeg* S) !RegAUsed (S, I+1) && !MemAccess (S, Push+1, Pop-1, E)) { - /* Insert a STA before the PHA */ + /* Insert a STA after the PHA */ X = NewCodeEntry (E->OPC, E->AM, E->Arg, E->JumpTo, E->LI); - CS_InsertEntry (S, X, Push); + CS_InsertEntry (S, X, Push+1); /* Remove the PHA instead */ - CS_DelEntry (S, Push+1); + CS_DelEntry (S, Push); /* Remove the PLA/STA sequence */ CS_DelEntries (S, Pop, 2); -- 2.39.5