Fixed #1806565
authorspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 20 Feb 2008 11:14:03 +0000 (11:14 +0000)
committerspth <spth@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 20 Feb 2008 11:14:03 +0000 (11:14 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5026 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/peeph-z80.def
src/z80/peeph.def

index 15cdfbd565ab8cadbf33ee07f3cee1fb896f82c2..ee588d7e753097ca114b4943da84b1b9e97cac94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-20 Philipp Klaus Krause <pkk AT spth.de>
+
+       * src/z80/peeph.def,
+       * src/z80/peeph-z80.def: moved peephole that breaks gbz80 to z80-specific peepholes,
+         fixes #1806565.
+
 2008-02-20 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/SDCCpeeph.c (operandBaseName): added check for @Ri
index 01901e87dbe50dbbebeadd8ca11143003aca4028..bb740d2a5a4e0db04d5bb2db8d18f6204097b352 100644 (file)
 // along with this program; if not, write to the Free Software
 // Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+// This can't go into peeph.def since %1 could be (hl+) on gbz80.
+replace restart {
+       ld      %1,%3
+       ld      %1,%2
+} by {
+       ; peephole z0 removed dead load into %1
+       ld      %1,%2
+} if notVolatile(%1 %3), operandsNotSame
+
 replace restart {
        ld      %1,#%2
        ld      a,0(%1)
index 02e485b79ef257fe8c0755dcf48f0176394fe643..1dc435b89a5e2ce209b25770e910aa53efa4f122 100644 (file)
@@ -23,14 +23,6 @@ replace restart {
        ; peephole 1 removed redundant load.
 } if notVolatile(%1)
 
-replace restart {
-       ld      %1,%3
-       ld      %1,%2
-} by {
-       ; peephole 2 removed dead load into %1
-       ld      %1,%2
-} if notVolatile(%1 %3), operandsNotSame
-
 replace restart {
        jp      NC,%1
        jp      %2