* debugger/mcs51/sdcdb.c: replaced hardcoded "/" with DIR_SEPARATOR_STRING
[fw/sdcc] / src / hc08 / peeph.def
index 93af395f532f237f518732889e32da6f91020121..1fddfa6df1d646857b33527fcc20fad2542d993c 100644 (file)
@@ -288,3 +288,29 @@ replace {
        ; Peephole 6b  - replaced jmp to rts with rts
        rts
 } if labelIsReturnOnly
+
+replace restart {
+       psha
+       lda     %1
+       sta     1,s
+} by {
+       ; Peephole 7  - optimized stack allocation
+       lda     %1
+       psha
+}
+
+replace restart {
+       lda     %1
+       sta     %1
+} by {
+       ; Peephole 8a  - removed redundant sta
+       lda     %1
+} if notVolatile %1
+
+replace restart {
+       sta     %1
+       lda     %1
+} by {
+       ; Peephole 8b  - removed redundant lda
+       sta     %1
+} if notVolatile %1