1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-01-12 03:30:09 +00:00

6502: Fix optimization bug

This commit is contained in:
Karol Stasiak 2019-05-30 22:16:46 +02:00
parent 4e46247803
commit c747d198e6

View File

@ -572,7 +572,7 @@ object LaterOptimizations {
code.tail.take(length) ++ (code(0).copy(opcode = LDA) :: code(length + 1).copy(opcode = STA) :: code.drop(length + 2))
},
(Elidable & HasOpcode(LAX) & Not(HasAddrMode(ZeroPageY)) & MatchAddrMode(0) & MatchParameter(0)) ~
(Elidable & HasOpcode(LAX) & Not(HasAddrMode(ZeroPageY))) ~
(Elidable & Linear & Not(ConcernsX) & Not(ChangesA)).*.captureLength(2) ~
(Elidable & HasOpcode(STX) & Not(HasAddrMode(ZeroPageY)) & DoesntMatterWhatItDoesWith(State.X)) ~~> { (code, ctx) =>
val length = ctx.get[Int](2)