- {
- werror (W_LOCAL_NOINIT,
- OP_SYMBOL (IC_JTCOND (ic))->name,
- ic->filename, ic->lineno);
- OP_REQV (IC_JTCOND (ic)) = NULL;
- OP_SYMBOL (IC_JTCOND (ic))->allocreq = 1;
- }
-
- if (IS_TRUE_SYMOP (IC_JTCOND (ic)) &&
- OP_REQV (IC_JTCOND (ic)))
- IC_JTCOND (ic) = opFromOpWithDU (OP_REQV (IC_JTCOND (ic)),
- OP_SYMBOL (IC_JTCOND (ic))->defs,
- OP_SYMBOL (IC_JTCOND (ic))->uses);
- continue;
- }
-
- if (ic->op == RECEIVE)
- {
- if (OP_SYMBOL (IC_RESULT (ic))->addrtaken)
- OP_SYMBOL (IC_RESULT (ic))->isspilt = 1;
- }
-
- /* general case */
- if (IC_RESULT (ic) &&
- IS_TRUE_SYMOP (IC_RESULT (ic)) &&
- OP_REQV (IC_RESULT (ic)))
- {
- if (POINTER_SET (ic))
- {
- IC_RESULT (ic) = opFromOpWithDU (OP_REQV (IC_RESULT (ic)),
- OP_SYMBOL (IC_RESULT (ic))->defs,
- OP_SYMBOL (IC_RESULT (ic))->uses);
- IC_RESULT (ic)->isaddr = 1;
- }
- else
- IC_RESULT (ic) = opFromOpWithDU (OP_REQV (IC_RESULT (ic)),
- OP_SYMBOL (IC_RESULT (ic))->defs,
- OP_SYMBOL (IC_RESULT (ic))->uses);
- }
-
- if (IC_RIGHT (ic) &&
- IS_TRUE_SYMOP (IC_RIGHT (ic)) &&
- isLocalWithoutDef (OP_SYMBOL (IC_RIGHT (ic))))
- {
- werror (W_LOCAL_NOINIT,
- OP_SYMBOL (IC_RIGHT (ic))->name,
- ic->filename, ic->lineno);
- OP_REQV (IC_RIGHT (ic)) = NULL;
- OP_SYMBOL (IC_RIGHT (ic))->allocreq = 1;
- }
-
- if (IC_RIGHT (ic) &&
- IS_TRUE_SYMOP (IC_RIGHT (ic)) &&
- OP_REQV (IC_RIGHT (ic)))
- {
- IC_RIGHT (ic) = opFromOpWithDU (OP_REQV (IC_RIGHT (ic)),
- OP_SYMBOL (IC_RIGHT (ic))->defs,
- OP_SYMBOL (IC_RIGHT (ic))->uses);
- IC_RIGHT (ic)->isaddr = 0;
- }
-
- if (IC_LEFT (ic) &&
- IS_TRUE_SYMOP (IC_LEFT (ic)) &&
- isLocalWithoutDef (OP_SYMBOL (IC_LEFT (ic))))
- {
- werror (W_LOCAL_NOINIT,
- OP_SYMBOL (IC_LEFT (ic))->name,
- ic->filename, ic->lineno);
- OP_REQV (IC_LEFT (ic)) = NULL;
- OP_SYMBOL (IC_LEFT (ic))->allocreq = 1;
- }
-
- if (IC_LEFT (ic) &&
- IS_TRUE_SYMOP (IC_LEFT (ic)) &&
- OP_REQV (IC_LEFT (ic)))
- {
- IC_LEFT (ic) = opFromOpWithDU (OP_REQV (IC_LEFT (ic)),
- OP_SYMBOL (IC_LEFT (ic))->defs,
- OP_SYMBOL (IC_LEFT (ic))->uses);
- IC_LEFT (ic)->isaddr = 0;
- }
- }
+ {
+ werrorfl (ic->filename, ic->lineno,
+ W_LOCAL_NOINIT,
+ OP_SYMBOL (IC_JTCOND (ic))->name);
+ OP_REQV (IC_JTCOND (ic)) = NULL;
+ OP_SYMBOL (IC_JTCOND (ic))->allocreq = 1;
+ }
+
+ if (IS_TRUE_SYMOP (IC_JTCOND (ic)) &&
+ OP_REQV (IC_JTCOND (ic)))
+ IC_JTCOND (ic) = opFromOpWithDU (OP_REQV (IC_JTCOND (ic)),
+ OP_SYMBOL (IC_JTCOND (ic))->defs,
+ OP_SYMBOL (IC_JTCOND (ic))->uses);
+ continue;
+ }
+
+ if (ic->op == RECEIVE)
+ {
+ if (OP_SYMBOL (IC_RESULT (ic))->addrtaken)
+ OP_SYMBOL (IC_RESULT (ic))->isspilt = 1;
+ }
+
+ /* general case */
+ if (IC_RESULT (ic) &&
+ IS_TRUE_SYMOP (IC_RESULT (ic)) &&
+ OP_REQV (IC_RESULT (ic)))
+ {
+ if (POINTER_SET (ic))
+ {
+ IC_RESULT (ic) = opFromOpWithDU (OP_REQV (IC_RESULT (ic)),
+ OP_SYMBOL (IC_RESULT (ic))->defs,
+ OP_SYMBOL (IC_RESULT (ic))->uses);
+ IC_RESULT (ic)->isaddr = 1;
+ }
+ else
+ IC_RESULT (ic) = opFromOpWithDU (OP_REQV (IC_RESULT (ic)),
+ OP_SYMBOL (IC_RESULT (ic))->defs,
+ OP_SYMBOL (IC_RESULT (ic))->uses);
+ }
+
+ if (IC_RIGHT (ic) &&
+ IS_TRUE_SYMOP (IC_RIGHT (ic)) &&
+ isLocalWithoutDef (OP_SYMBOL (IC_RIGHT (ic))))
+ {
+ werrorfl (ic->filename, ic->lineno,
+ W_LOCAL_NOINIT,
+ OP_SYMBOL (IC_RIGHT (ic))->name);
+ OP_REQV (IC_RIGHT (ic)) = NULL;
+ OP_SYMBOL (IC_RIGHT (ic))->allocreq = 1;
+ }
+
+ if (IC_RIGHT (ic) &&
+ IS_TRUE_SYMOP (IC_RIGHT (ic)) &&
+ OP_REQV (IC_RIGHT (ic)))
+ {
+ IC_RIGHT (ic) = opFromOpWithDU (OP_REQV (IC_RIGHT (ic)),
+ OP_SYMBOL (IC_RIGHT (ic))->defs,
+ OP_SYMBOL (IC_RIGHT (ic))->uses);
+ IC_RIGHT (ic)->isaddr = 0;
+ }
+
+ if (IC_LEFT (ic) &&
+ IS_TRUE_SYMOP (IC_LEFT (ic)) &&
+ isLocalWithoutDef (OP_SYMBOL (IC_LEFT (ic))))
+ {
+ werrorfl (ic->filename, ic->lineno,
+ W_LOCAL_NOINIT,
+ OP_SYMBOL (IC_LEFT (ic))->name);
+ OP_REQV (IC_LEFT (ic)) = NULL;
+ OP_SYMBOL (IC_LEFT (ic))->allocreq = 1;
+ }
+
+ if (IC_LEFT (ic) &&
+ IS_TRUE_SYMOP (IC_LEFT (ic)) &&
+ OP_REQV (IC_LEFT (ic)))
+ {
+ IC_LEFT (ic) = opFromOpWithDU (OP_REQV (IC_LEFT (ic)),
+ OP_SYMBOL (IC_LEFT (ic))->defs,
+ OP_SYMBOL (IC_LEFT (ic))->uses);
+ IC_LEFT (ic)->isaddr = 0;
+ }
+ }
+ }
+}
+
+/*-----------------------------------------------------------------*/
+/* findReqv - search for a register equivalent */
+/*-----------------------------------------------------------------*/
+operand *
+findReqv (symbol * prereqv, eBBlock ** ebbs, int count)
+{
+ int i;
+ iCode * ic;
+
+ /* for all blocks do */
+ for (i=0; i<count; i++)
+ {
+ /* for all instructions in the block do */
+ for (ic = ebbs[i]->sch; ic; ic = ic->next)
+ {
+ if (ic->op == IFX)
+ {
+ if (IS_ITEMP (IC_COND (ic))
+ && OP_SYMBOL (IC_COND (ic))->prereqv == prereqv)
+ return IC_COND (ic);
+ }
+ else if (ic->op == JUMPTABLE)
+ {
+ if (IS_ITEMP (IC_JTCOND (ic))
+ && OP_SYMBOL (IC_JTCOND (ic))->prereqv == prereqv)
+ return IC_JTCOND (ic);
+ }
+ else
+ {
+ if (IS_ITEMP (IC_LEFT (ic))
+ && OP_SYMBOL (IC_LEFT (ic))->prereqv == prereqv)
+ return IC_LEFT (ic);
+ if (IS_ITEMP (IC_RIGHT (ic))
+ && OP_SYMBOL (IC_RIGHT (ic))->prereqv == prereqv)
+ return IC_RIGHT (ic);
+ if (IS_ITEMP (IC_RESULT (ic))
+ && OP_SYMBOL (IC_RESULT (ic))->prereqv == prereqv)
+ return IC_RESULT (ic);
+ }
+ }