+2004-01-09 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+ * src/ds390/main.c,
+ * src/z80/main.c: added missed needLinkerScript flags (more than
+ one port structure defined in these file)
+ * src/ds390/gen.c (aopForSym, aopOp, operandsEqu, aopOp3): fixed
+ bug #795325
+
2004-01-08 Vangelis Rokas <vrokas@otenet.gr>
* src/SDCCmain.c: removed various references to DEFAULT_PORT
/* if already has one */
if (sym->aop)
- return sym->aop;
+ {
+ if ((sym->aop->type == AOP_DPTR && useDP2)
+ || (sym->aop->type == AOP_DPTR2 && !useDP2))
+ sym->aop = NULL;
+ else
+ return sym->aop;
+ }
/* assign depending on the storage class */
/* if it is on the stack or indirectly addressable */
(sym2->usl.spillLoc == sym1))
return TRUE;
+ /* are they spilt to the same location */
+ if (IS_ITEMP (op2) &&
+ IS_ITEMP (op1) &&
+ sym2->isspilt &&
+ sym1->isspilt &&
+ (sym1->usl.spillLoc == sym1->usl.spillLoc))
+ return TRUE;
+
return FALSE;
}
/* if already has a asmop then continue */
if (op->aop)
- return;
+ {
+ if ((op->aop->type == AOP_DPTR && useDP2)
+ || (op->aop->type == AOP_DPTR2 && !useDP2))
+ op->aop = NULL;
+ else
+ return;
+ }
/* if the underlying symbol has a aop */
if (IS_SYMOP (op) && OP_SYMBOL (op)->aop)
{
op->aop = OP_SYMBOL (op)->aop;
- return;
+ if ((op->aop->type == AOP_DPTR && useDP2)
+ || (op->aop->type == AOP_DPTR2 && !useDP2))
+ op->aop = NULL;
+ else
+ return;
}
/* if this is a true symbol */
}
aopOp(IC_LEFT(ic), ic, FALSE, useDp2);
-
+
+
// 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)) ||
return TRUE;
}
+ // Operands may be equivalent (but not equal) if they share a spill location. If
+ // so, use the same DPTR or DPTR2.
+ if (operandsEqu (IC_LEFT(ic), IC_RESULT(ic)))
+ {
+ aopOp (IC_RESULT (ic), ic, TRUE, AOP_USESDPTR2 (IC_LEFT (ic)));
+ return TRUE;
+ }
+ if (operandsEqu (IC_RIGHT(ic), IC_RESULT(ic)))
+ {
+ aopOp (IC_RESULT (ic), ic, TRUE, AOP_USESDPTR2 (IC_RIGHT (ic)));
+ return TRUE;
+ }
+
// Note which dptrs are currently in use.
dp1InUse = AOP_USESDPTR(IC_LEFT(ic)) || AOP_USESDPTR(IC_RIGHT(ic));
dp2InUse = AOP_USESDPTR2(IC_LEFT(ic)) || AOP_USESDPTR2(IC_RIGHT(ic));