From 4d24003870d508e0b94e762d73398afd6cdde612 Mon Sep 17 00:00:00 2001 From: kflittner Date: Fri, 16 Jan 2004 16:30:00 +0000 Subject: [PATCH] * src/ds390/gen.c (aopOp3): fixed the assignment of different dptrs to equal operands git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3138 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ src/ds390/gen.c | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 566c547f..d974bea6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-01-16 Klaus Flittner + + * src/ds390/gen.c (aopOp3): fixed the assignment of different dptrs to + equal operands + 2004-01-16 Vangelis Rokas * src/SDCCmain.c (linkEdit): variable $3 of the linker command is diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 979d993e..39acbf48 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -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. -- 2.30.2