* src/ds390/gen.c (aopOp3): fixed the assignment of different dptrs to
authorkflittner <kflittner@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 16 Jan 2004 16:30:00 +0000 (16:30 +0000)
committerkflittner <kflittner@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 16 Jan 2004 16:30:00 +0000 (16:30 +0000)
equal operands

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3138 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/ds390/gen.c

index 566c547f20fa0256e5a63b2bece4631b91c60fae..d974bea6421de93607269d284ec8142abc4427f4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-16 Klaus Flittner <klaus_flittner@gmx.de>
+
+       * src/ds390/gen.c (aopOp3): fixed the assignment of different dptrs to
+       equal operands
+
 2004-01-16 Vangelis Rokas <vrokas@otenet.gr>
 
        * src/SDCCmain.c (linkEdit): variable $3 of the linker command is
index 979d993e9373525f442027e43f4c535d761dc278..39acbf4805abf3702c40f00e523948af031615f6 100644 (file)
@@ -3894,7 +3894,7 @@ bool aopOp3(iCode * ic)
 {
     bool dp1InUse, dp2InUse;
     bool useDp2;
-    
+
     // First, generate the right opcode. DPTR may be used if neither left nor result are
     // of type AOP_STR.
     
@@ -3954,13 +3954,17 @@ bool aopOp3(iCode * ic)
         
     // We've op'd the left & right. So, if left or right are the same operand as result, 
     // we know aopOp will succeed, and we can just do it & bail.
-    if (isOperandEqual(IC_LEFT(ic),IC_RESULT(ic)) ||
-       isOperandEqual(IC_RIGHT(ic),IC_RESULT(ic)))
-    {
+    if (isOperandEqual(IC_LEFT(ic),IC_RESULT(ic)))
+      {
+       aopOp (IC_RESULT (ic), ic, TRUE, AOP_USESDPTR2 (IC_LEFT (ic)));
+       return TRUE;
+      }
+    if (isOperandEqual(IC_RIGHT(ic),IC_RESULT(ic)))
+      {
 //     D(emitcode(";", "aopOp3: (left | right) & result equal"););
-       aopOp(IC_RESULT(ic),ic,TRUE, FALSE);
+       aopOp(IC_RESULT(ic),ic,TRUE, AOP_USESDPTR2 (IC_RIGHT (ic)));
        return TRUE;
-    }
+      }
     
     // Operands may be equivalent (but not equal) if they share a spill location. If
     // so, use the same DPTR or DPTR2.