1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-11-17 16:05:31 +00:00
This commit is contained in:
Karol Stasiak 2019-08-04 13:40:49 +02:00
parent dfda9f9283
commit 1a87929ad3
3 changed files with 4 additions and 2 deletions

View File

@ -42,6 +42,8 @@ This matches both the CC65 behaviour and the return values from `readkey()`.
* incorrect removal of unused local variables; * incorrect removal of unused local variables;
* broken parameter passing to tail calls;
* 6502: miscompilation when using the zeropage pseudoregister; * 6502: miscompilation when using the zeropage pseudoregister;
* 6502: stack overflow when inlining local variables into registers; * 6502: stack overflow when inlining local variables into registers;

View File

@ -825,7 +825,7 @@ object AlwaysGoodOptimizations {
(Elidable & HasOpcode(JSR)) ~ (Elidable & HasOpcode(JSR)) ~
HasOpcode(LABEL).* ~ HasOpcode(LABEL).* ~
NoopDiscardsFlags.*.capture(0) ~ 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", val UnusedCodeRemoval = new RuleBasedAssemblyOptimization("Unreachable code removal",

View File

@ -138,7 +138,7 @@ object LaterI80Optimizations {
HasOpcode(LABEL).* ~ HasOpcode(LABEL).* ~
(Elidable & HasOpcodeIn(ZOpcodeClasses.NoopDiscards)).*.capture(0) ~ (Elidable & HasOpcodeIn(ZOpcodeClasses.NoopDiscards)).*.capture(0) ~
(Elidable & HasOpcode(RET) & HasRegisters(NoRegisters)) ~~> { (code, ctx) => (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
}, },
) )