mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-11 12:29:46 +00:00
Fix TCO
This commit is contained in:
parent
dfda9f9283
commit
1a87929ad3
@ -41,6 +41,8 @@ This matches both the CC65 behaviour and the return values from `readkey()`.
|
||||
* Fixed many optimization bugs:
|
||||
|
||||
* incorrect removal of unused local variables;
|
||||
|
||||
* broken parameter passing to tail calls;
|
||||
|
||||
* 6502: miscompilation when using the zeropage pseudoregister;
|
||||
|
||||
|
@ -825,7 +825,7 @@ object AlwaysGoodOptimizations {
|
||||
(Elidable & HasOpcode(JSR)) ~
|
||||
HasOpcode(LABEL).* ~
|
||||
NoopDiscardsFlags.*.capture(0) ~
|
||||
HasOpcode(RTS) ~~> ((code, ctx) => ctx.get[List[AssemblyLine]](0) ++ (code.head.copy(opcode = JMP) :: code.tail)),
|
||||
HasOpcode(RTS) ~~> ((code, ctx) => code.head.copy(opcode = JMP) :: code.tail),
|
||||
)
|
||||
|
||||
val UnusedCodeRemoval = new RuleBasedAssemblyOptimization("Unreachable code removal",
|
||||
|
@ -138,7 +138,7 @@ object LaterI80Optimizations {
|
||||
HasOpcode(LABEL).* ~
|
||||
(Elidable & HasOpcodeIn(ZOpcodeClasses.NoopDiscards)).*.capture(0) ~
|
||||
(Elidable & HasOpcode(RET) & HasRegisters(NoRegisters)) ~~> { (code, ctx) =>
|
||||
ctx.get[List[ZLine]](0) ++ (code.head.copy(opcode = JP) :: code.tail)
|
||||
code.head.copy(opcode = JP) :: code.tail
|
||||
},
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user