mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 02:29:52 +00:00
Fixed wrong insertion order that caused problems with labels.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4021 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
b4fda62df9
commit
14b00447a8
@ -38,10 +38,10 @@
|
|||||||
|
|
||||||
/* cc65 */
|
/* cc65 */
|
||||||
#include "codeent.h"
|
#include "codeent.h"
|
||||||
|
#include "coptind.h"
|
||||||
#include "codeinfo.h"
|
#include "codeinfo.h"
|
||||||
#include "codeopt.h"
|
#include "codeopt.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "coptind.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -640,7 +640,7 @@ unsigned OptJumpTarget2 (CodeSeg* S)
|
|||||||
/* Jump target insn, old and new */
|
/* Jump target insn, old and new */
|
||||||
CodeEntry* T;
|
CodeEntry* T;
|
||||||
CodeEntry* N;
|
CodeEntry* N;
|
||||||
|
|
||||||
/* New jump label */
|
/* New jump label */
|
||||||
CodeLabel* L;
|
CodeLabel* L;
|
||||||
|
|
||||||
@ -1437,11 +1437,11 @@ unsigned OptTransfers3 (CodeSeg* S)
|
|||||||
|
|
||||||
/* If we have a replacement store, change the code */
|
/* If we have a replacement store, change the code */
|
||||||
if (X) {
|
if (X) {
|
||||||
/* Insert before the xfer insn */
|
/* Insert after the xfer insn */
|
||||||
CS_InsertEntry (S, X, Xfer);
|
CS_InsertEntry (S, X, Xfer+1);
|
||||||
|
|
||||||
/* Remove the xfer instead */
|
/* Remove the xfer instead */
|
||||||
CS_DelEntry (S, Xfer+1);
|
CS_DelEntry (S, Xfer);
|
||||||
|
|
||||||
/* Remove the final store */
|
/* Remove the final store */
|
||||||
CS_DelEntry (S, Store);
|
CS_DelEntry (S, Store);
|
||||||
@ -1595,11 +1595,11 @@ unsigned OptTransfers4 (CodeSeg* S)
|
|||||||
|
|
||||||
/* If we have a replacement load, change the code */
|
/* If we have a replacement load, change the code */
|
||||||
if (X) {
|
if (X) {
|
||||||
/* Insert before the xfer insn */
|
/* Insert after the xfer insn */
|
||||||
CS_InsertEntry (S, X, Xfer);
|
CS_InsertEntry (S, X, Xfer+1);
|
||||||
|
|
||||||
/* Remove the xfer instead */
|
/* Remove the xfer instead */
|
||||||
CS_DelEntry (S, Xfer+1);
|
CS_DelEntry (S, Xfer);
|
||||||
|
|
||||||
/* Remove the initial load */
|
/* Remove the initial load */
|
||||||
CS_DelEntry (S, Load);
|
CS_DelEntry (S, Load);
|
||||||
@ -1703,12 +1703,12 @@ unsigned OptPushPop (CodeSeg* S)
|
|||||||
!RegAUsed (S, I+1) &&
|
!RegAUsed (S, I+1) &&
|
||||||
!MemAccess (S, Push+1, Pop-1, E->Arg)) {
|
!MemAccess (S, Push+1, Pop-1, E->Arg)) {
|
||||||
|
|
||||||
/* Insert a STA before the PHA */
|
/* Insert a STA after the PHA */
|
||||||
X = NewCodeEntry (E->OPC, E->AM, E->Arg, E->JumpTo, E->LI);
|
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 */
|
/* Remove the PHA instead */
|
||||||
CS_DelEntry (S, Push+1);
|
CS_DelEntry (S, Push);
|
||||||
|
|
||||||
/* Remove the PLA/STA sequence */
|
/* Remove the PLA/STA sequence */
|
||||||
CS_DelEntries (S, Pop, 2);
|
CS_DelEntries (S, Pop, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user