(*opp)->isaddr = cop->isaddr;
}
+ if ((*opp)->type==VALUE &&
+ IS_SYMOP(cop) &&
+ !IS_SPEC(OP_SYMBOL(cop)->type)) {
+ // this could be a pointer to some space, so we can not
+ *opp=NULL;
+ return 0;
+ }
+
return 1;
}
/* updateSpillLocation - keeps track of register spill location */
/*-----------------------------------------------------------------*/
void
-updateSpillLocation (iCode * ic)
+updateSpillLocation (iCode * ic, int induction)
{
- sym_link *setype;
-
- if (POINTER_SET (ic))
- return;
-
- if (ic->nosupdate)
- return;
-
- /* for the form true_symbol := iTempNN */
- if (ASSIGN_ITEMP_TO_SYM (ic)
- && !SPIL_LOC (IC_RIGHT (ic)))
- {
+ sym_link *setype;
- setype = getSpec (operandType (IC_RESULT (ic)));
+ if (POINTER_SET (ic))
+ return;
- if (!IC_RIGHT (ic)->noSpilLoc &&
- !IS_VOLATILE (setype) &&
- !IN_FARSPACE (SPEC_OCLS (setype)) &&
- !OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))))
+ if (ic->nosupdate)
+ return;
- SPIL_LOC (IC_RIGHT (ic)) =
- IC_RESULT (ic)->operand.symOperand;
- }
+ /* for the form true_symbol := iTempNN */
+ if (ASSIGN_ITEMP_TO_SYM (ic) &&
+ !SPIL_LOC (IC_RIGHT (ic))) {
- if (ASSIGN_ITEMP_TO_ITEMP (ic) &&
- !SPIL_LOC (IC_RIGHT (ic)) &&
- !bitVectBitsInCommon (OP_DEFS (IC_RIGHT (ic)), OP_USES (IC_RESULT (ic))) &&
- OP_SYMBOL (IC_RESULT (ic))->isreqv)
- {
+ setype = getSpec (operandType (IC_RESULT (ic)));
- setype = getSpec (operandType (IC_RESULT (ic)));
+ if (!OP_SYMBOL(IC_RIGHT (ic))->noSpilLoc &&
+ !IS_VOLATILE (setype) &&
+ !IN_FARSPACE (SPEC_OCLS (setype)) &&
+ !OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))))
- if (!IC_RIGHT (ic)->noSpilLoc &&
- !IS_VOLATILE (setype) &&
- !IN_FARSPACE (SPEC_OCLS (setype)) &&
- !OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))))
+ SPIL_LOC (IC_RIGHT (ic)) =
+ IC_RESULT (ic)->operand.symOperand;
+ }
- SPIL_LOC (IC_RIGHT (ic)) =
- SPIL_LOC (IC_RESULT (ic));
- }
+ if (ASSIGN_ITEMP_TO_ITEMP (ic)) {
+
+ if (!SPIL_LOC (IC_RIGHT (ic)) &&
+ !bitVectBitsInCommon (OP_DEFS (IC_RIGHT (ic)), OP_USES (IC_RESULT (ic))) &&
+ OP_SYMBOL (IC_RESULT (ic))->isreqv) {
+
+ setype = getSpec (operandType (IC_RESULT (ic)));
+
+ if (!OP_SYMBOL(IC_RIGHT (ic))->noSpilLoc &&
+ !IS_VOLATILE (setype) &&
+ !IN_FARSPACE (SPEC_OCLS (setype)) &&
+ !OTHERS_PARM (OP_SYMBOL (IC_RESULT (ic))))
+
+ SPIL_LOC (IC_RIGHT (ic)) =
+ SPIL_LOC (IC_RESULT (ic));
+ }
+ /* special case for inductions */
+ if (induction &&
+ OP_SYMBOL(IC_RIGHT(ic))->isreqv &&
+ !OP_SYMBOL(IC_RESULT (ic))->noSpilLoc &&
+ !SPIL_LOC(IC_RESULT(ic))) {
+ SPIL_LOC (IC_RESULT (ic)) = SPIL_LOC (IC_RIGHT (ic));
+ }
+ }
}
-
/*-----------------------------------------------------------------*/
/* setUsesDef - sets the uses def bitvector for a given operand */
/*-----------------------------------------------------------------*/
if (IS_ITEMP (IC_RESULT (ic)))
{
SPIL_LOC (IC_RESULT (ic)) = NULL;
- IC_RESULT (ic)->noSpilLoc = 1;
+ OP_SYMBOL(IC_RESULT (ic))->noSpilLoc = 1;
}
{
sym_link *t1 = operandType (IC_LEFT (ic)), *t2;
- if (TARGET_IS_DS390)
+ /* if (TARGET_IS_DS390) */
+ if (options.model == MODEL_FLAT24)
{
/* hack-o-matic! */
return;
{
/* update the spill location for this */
- updateSpillLocation (ic);
+ updateSpillLocation (ic,0);
if (POINTER_SET (ic) &&
!(IS_BITFIELD (OP_SYMBOL (IC_RESULT (ic))->etype)))