else
sym->regs[j] = getRegGpr (ic, ebbs[i], sym);
- /* if the allocation falied which means
+ /* if the allocation failed which means
this was spilt then break */
- if (!sym->regs[j])
- break;
+ if (!sym->regs[j]) {
+ if (j) {
+ fprintf (stderr, "%d reg(s) lost in %s:%d\n",
+ j, __FILE__,__LINE__);
+ }
+ break;
+ }
}
/* if it shares registers with operands make sure
/*-----------------------------------------------------------------*/
/* rUmaskForOp :- returns register mask for an operand */
/*-----------------------------------------------------------------*/
-static bitVect *
-rUmaskForOp (operand * op)
+bitVect *
+mcs51_rUmaskForOp (operand * op)
{
bitVect *rumask;
symbol *sym;
if (ic->op == IFX)
{
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_COND (ic)));
+ mcs51_rUmaskForOp (IC_COND (ic)));
goto ret;
}
if (ic->op == JUMPTABLE)
{
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_JTCOND (ic)));
+ mcs51_rUmaskForOp (IC_JTCOND (ic)));
goto ret;
}
/* of all other cases */
if (IC_LEFT (ic))
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_LEFT (ic)));
+ mcs51_rUmaskForOp (IC_LEFT (ic)));
if (IC_RIGHT (ic))
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_RIGHT (ic)));
+ mcs51_rUmaskForOp (IC_RIGHT (ic)));
if (IC_RESULT (ic))
rmask = bitVectUnion (rmask,
- rUmaskForOp (IC_RESULT (ic)));
+ mcs51_rUmaskForOp (IC_RESULT (ic)));
ret:
return rmask;
/* only upto 2 bytes since we cannot predict
the usage of b, & acc */
- if (getSize (operandType (op)) > (fReturnSizeMCS51 - 2) &&
- ic->op != RETURN &&
+ if (getSize (operandType (op)) > (fReturnSizeMCS51 - 2))
+ return NULL;
+
+ if (ic->op != RETURN &&
ic->op != SEND &&
!POINTER_SET (ic) &&
!POINTER_GET (ic))
return NULL;
-
+
/* this routine will mark the a symbol as used in one
instruction use only && if the defintion is local
(ie. within the basic block) && has only one definition &&