+2004-02-10 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+ * src/ds390/gen.c (genNearPointerGet),
+ * src/mcs51/gen.c (genNearPointerGet): allow the genDataPointerGet()
+ optimization with bits, but not bitfields.
+ * src/ds390/ralloc.c (packRegisters),
+ * src/mcs51/ralloc.c (packRegisters): fixed bug #884453 & #880832
+
2004-02-09 Bernhard Held <bernhard AT bernhardheld.de>
* src/SDCCcse.c (algebraicOpts): copy operands before modification
aopOp (left, ic, FALSE, FALSE);
/* if left is rematerialisable and
- result is not bit variable type and
+ result is not bitfield variable type and
the left is pointer to data space i.e
lower 128 bytes of space */
if (AOP_TYPE (left) == AOP_IMMD &&
- !IS_BITVAR (retype) &&
- !IS_BITVAR (letype) &&
+ !IS_BITFIELD (retype) &&
+ !IS_BITFIELD (letype) &&
DCL_TYPE (ltype) == POINTER)
{
genDataPointerGet (left, result, ic);
{
/* if we are using a symbol on the stack
then we should say ds390_ptrRegReq */
+ if (options.useXstack && ic->parmPush
+ && (ic->op == IPUSH || ic->op == IPOP))
+ ds390_ptrRegReq++;
if (ic->op == IFX && IS_SYMOP (IC_COND (ic)))
ds390_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack ? !options.stack10bit : 0) +
- OP_SYMBOL (IC_COND (ic))->iaccess);
+ OP_SYMBOL (IC_COND (ic))->iaccess +
+ (SPEC_OCLS(OP_SYMBOL (IC_COND (ic))->etype) == idata));
else if (ic->op == JUMPTABLE && IS_SYMOP (IC_JTCOND (ic)))
ds390_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack ? !options.stack10bit : 0) +
- OP_SYMBOL (IC_JTCOND (ic))->iaccess);
+ OP_SYMBOL (IC_JTCOND (ic))->iaccess +
+ (SPEC_OCLS(OP_SYMBOL (IC_JTCOND (ic))->etype) == idata));
else
{
if (IS_SYMOP (IC_LEFT (ic)))
ds390_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack ? !options.stack10bit : 0) +
- OP_SYMBOL (IC_LEFT (ic))->iaccess);
+ OP_SYMBOL (IC_LEFT (ic))->iaccess +
+ (SPEC_OCLS(OP_SYMBOL (IC_LEFT (ic))->etype) == idata));
if (IS_SYMOP (IC_RIGHT (ic)))
ds390_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack ? !options.stack10bit : 0) +
- OP_SYMBOL (IC_RIGHT (ic))->iaccess);
+ OP_SYMBOL (IC_RIGHT (ic))->iaccess +
+ (SPEC_OCLS(OP_SYMBOL (IC_RIGHT (ic))->etype) == idata));
if (IS_SYMOP (IC_RESULT (ic)))
ds390_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack ? !options.stack10bit : 0) +
- OP_SYMBOL (IC_RESULT (ic))->iaccess);
+ OP_SYMBOL (IC_RESULT (ic))->iaccess +
+ (SPEC_OCLS(OP_SYMBOL (IC_RESULT (ic))->etype) == idata));
}
}
while (isspace (*lbp))
lbp++;
- //printf ("%s\n", lb);
+ // printf ("%s\n", lb);
if (lbp && *lbp)
lineCurr = (lineCurr ?
aopOp (left, ic, FALSE);
/* if left is rematerialisable and
- result is not bit variable type and
+ result is not bitfield variable type and
the left is pointer to data space i.e
lower 128 bytes of space */
if (AOP_TYPE (left) == AOP_IMMD &&
- !IS_BITVAR (retype) &&
+ !IS_BITFIELD (retype) &&
DCL_TYPE (ltype) == POINTER)
{
genDataPointerGet (left, result, ic);
{
/* if we are using a symbol on the stack
then we should say mcs51_ptrRegReq */
+ if (options.useXstack && ic->parmPush
+ && (ic->op == IPUSH || ic->op == IPOP))
+ mcs51_ptrRegReq++;
if (ic->op == IFX && IS_SYMOP (IC_COND (ic)))
mcs51_ptrRegReq += ((OP_SYMBOL (IC_COND (ic))->onStack ||
- OP_SYMBOL (IC_COND (ic))->iaccess) ? 1 : 0);
+ OP_SYMBOL (IC_COND (ic))->iaccess ||
+ SPEC_OCLS(OP_SYMBOL (IC_COND (ic))->etype) == idata) ? 1 : 0);
else if (ic->op == JUMPTABLE && IS_SYMOP (IC_JTCOND (ic)))
mcs51_ptrRegReq += ((OP_SYMBOL (IC_JTCOND (ic))->onStack ||
- OP_SYMBOL (IC_JTCOND (ic))->iaccess) ? 1 : 0);
+ OP_SYMBOL (IC_JTCOND (ic))->iaccess ||
+ SPEC_OCLS(OP_SYMBOL (IC_JTCOND (ic))->etype) == idata) ? 1 : 0);
else
{
if (IS_SYMOP (IC_LEFT (ic)))
mcs51_ptrRegReq += ((OP_SYMBOL (IC_LEFT (ic))->onStack ||
- OP_SYMBOL (IC_LEFT (ic))->iaccess) ? 1 : 0);
+ OP_SYMBOL (IC_LEFT (ic))->iaccess ||
+ SPEC_OCLS(OP_SYMBOL (IC_LEFT (ic))->etype) == idata) ? 1 : 0);
if (IS_SYMOP (IC_RIGHT (ic)))
mcs51_ptrRegReq += ((OP_SYMBOL (IC_RIGHT (ic))->onStack ||
- OP_SYMBOL (IC_RIGHT (ic))->iaccess) ? 1 : 0);
+ OP_SYMBOL (IC_RIGHT (ic))->iaccess ||
+ SPEC_OCLS(OP_SYMBOL (IC_RIGHT (ic))->etype) == idata) ? 1 : 0);
if (IS_SYMOP (IC_RESULT (ic)))
mcs51_ptrRegReq += ((OP_SYMBOL (IC_RESULT (ic))->onStack ||
- OP_SYMBOL (IC_RESULT (ic))->iaccess) ? 1 : 0);
+ OP_SYMBOL (IC_RESULT (ic))->iaccess ||
+ SPEC_OCLS(OP_SYMBOL (IC_RESULT (ic))->etype) == idata) ? 1 : 0);
}
}