mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
Always insert a LDA after the removed PLA during the optimization in OptPushPop.
Fixed Issue 971.
This commit is contained in:
parent
5b11eb4bb9
commit
9559625ee8
@ -1948,17 +1948,22 @@ unsigned OptPushPop (CodeSeg* S)
|
||||
!MemAccess (S, Push+1, Pop-1, E)) {
|
||||
|
||||
/* Insert a STA after the PHA */
|
||||
X = NewCodeEntry (E->OPC, E->AM, E->Arg, E->JumpTo, E->LI);
|
||||
X = NewCodeEntry (OP65_STA, E->AM, E->Arg, E->JumpTo, E->LI);
|
||||
CS_InsertEntry (S, X, Push+1);
|
||||
|
||||
/* Remove the PHA instead */
|
||||
CS_DelEntry (S, Push);
|
||||
|
||||
/* Insert a LDA after the PLA */
|
||||
X = NewCodeEntry (OP65_LDA, E->AM, E->Arg, E->JumpTo, CS_GetEntry (S, Pop)->LI);
|
||||
CS_InsertEntry (S, X, Pop+1);
|
||||
|
||||
/* Remove the PLA/STA sequence */
|
||||
CS_DelEntries (S, Pop, 2);
|
||||
CS_DelEntry (S, Pop);
|
||||
CS_DelEntry (S, I);
|
||||
|
||||
/* Correct I so we continue with the next insn */
|
||||
I -= 2;
|
||||
--I;
|
||||
|
||||
/* Remember we had changes */
|
||||
++Changes;
|
||||
|
Loading…
x
Reference in New Issue
Block a user