Fixed bug 772726
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 18 Jul 2003 20:33:24 +0000 (20:33 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 18 Jul 2003 20:33:24 +0000 (20:33 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2752 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/gen.c

index 62554fdfcde8504acd2404c85f5eb8b00b812461..233b3a35e312b87a7ccc3f7cf7d13a404955ed70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-07-18  Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/z80/gen.c: fixed some right shift bugs (#772726 among them)
+
 2003-07-17  Jesus Calvino-Fraga <jesusc@ece.ubc.ca>
 
     * link/z80/lklibr.c: fixed bug when there is a '.' in a library path.
index b5f0afc975a66fb4c0b35702e14f32b4d27bac53..f855a0e2228ed7e778bf9e0faef3f5514d86ce23 100644 (file)
@@ -5965,13 +5965,16 @@ genRightShift (iCode * ic)
       return;
     }
 
+  emit2 ("ld a,%s", aopGet (AOP (right), 0, FALSE));
+  emit2 ("inc a");
+  freeAsmop (right, NULL, ic);
+
   aopOp (left, ic, FALSE, FALSE);
   aopOp (result, ic, FALSE, FALSE);
 
   /* now move the left to the result if they are not the
      same */
-  if (!sameRegs (AOP (left), AOP (result)) &&
-      AOP_SIZE (result) > 1)
+  if (!sameRegs (AOP (left), AOP (result)))
     {
 
       size = AOP_SIZE (result);
@@ -5984,10 +5987,6 @@ genRightShift (iCode * ic)
        }
     }
 
-  emit2 ("ld a,%s", aopGet (AOP (right), 0, FALSE));
-  emit2 ("inc a");
-  freeAsmop (right, NULL, ic);
-
   tlbl = newiTempLabel (NULL);
   tlbl1 = newiTempLabel (NULL);
   size = AOP_SIZE (result);