zeroing data from acculator after jnz comparison
authorfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 22 Oct 2004 14:52:59 +0000 (14:52 +0000)
committerfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 22 Oct 2004 14:52:59 +0000 (14:52 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3553 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/mcs51/peeph.def

index 8fa20f57041bf246a7acc713ee93e2ceaf0e47a1..e6540fcf8df73449c371b1224ae9dc65a3fc06e2 100644 (file)
@@ -3418,6 +3418,30 @@ replace {
 %2:
 } if labelRefCount %2 0
 
+// applies to f.e. malloc.c
+replace {
+       jnz     %1
+%2:
+       mov     %3,#0x00
+       mov     %4,#0x00
+} by {
+       ;       Peephole 256.c  loading %3,%4 with zero from a
+       jnz     %1
+       mov     %3,a
+       mov     %4,a
+} if labelRefCount %2 0
+
+// applies to f.e. bug-905492.c
+replace {
+       jnz     %1
+%2:
+       mov     %3,#0x00
+} by {
+       ;       Peephole 256.d  loading %3 with zero from a
+       jnz     %1
+       mov     %3,a
+} if labelRefCount %2 0
+
 
 // unsigned char i=8; do{ } while(--i != 0);
 // this currently only applies if i is kept in a register