if (!lbl)
return FALSE;
+ /* Don't optimize jumps in a jump table; a more generic test */
+ if (currPl->ic && currPl->ic->op == JUMPTABLE)
+ return FALSE;
+
/* if the previous two instructions are "ljmp"s then don't
do it since it can be part of a jump table */
if (currPl->prev && currPl->prev->prev &&
if (cl->ic && (cl->ic!=last_ic))
{
last_ic = cl->ic;
- op = IC_LEFT (cl->ic);
- if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
- return !op->isvolatile;
- op = IC_RIGHT (cl->ic);
- if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
- return !op->isvolatile;
- op = IC_RESULT (cl->ic);
- if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
- return !op->isvolatile;
+ switch (cl->ic->op)
+ {
+ case IFX:
+ op = IC_COND (cl->ic);
+ if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
+ return !op->isvolatile;
+ case JUMPTABLE:
+ op = IC_JTCOND (cl->ic);
+ if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
+ return !op->isvolatile;
+ default:
+ op = IC_LEFT (cl->ic);
+ if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
+ return !op->isvolatile;
+ op = IC_RIGHT (cl->ic);
+ if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
+ return !op->isvolatile;
+ op = IC_RESULT (cl->ic);
+ if (IS_SYMOP (op) && !strcmp(OP_SYMBOL (op)->rname,symname) )
+ return !op->isvolatile;
+ }
}
}
{
if (cl->ic)
{
- op = IC_LEFT (cl->ic);
- if (IS_SYMOP (op) && op->isvolatile)
- return FALSE;
- op = IC_RIGHT (cl->ic);
- if (IS_SYMOP (op) && op->isvolatile)
- return FALSE;
- op = IC_RESULT (cl->ic);
- if (IS_SYMOP (op) && op->isvolatile)
- return FALSE;
+ switch (cl->ic->op)
+ {
+ case IFX:
+ op = IC_COND (cl->ic);
+ if (IS_SYMOP (op) && op->isvolatile)
+ return FALSE;
+ case JUMPTABLE:
+ op = IC_JTCOND (cl->ic);
+ if (IS_SYMOP (op) && op->isvolatile)
+ return FALSE;
+ default:
+ op = IC_LEFT (cl->ic);
+ if (IS_SYMOP (op) && op->isvolatile)
+ return FALSE;
+ op = IC_RIGHT (cl->ic);
+ if (IS_SYMOP (op) && op->isvolatile)
+ return FALSE;
+ op = IC_RESULT (cl->ic);
+ if (IS_SYMOP (op) && op->isvolatile)
+ return FALSE;
+ }
}
}
return TRUE;
lineNode *spl; /* source pl */
lineNode *rpl; /* rule peep line */
-/* setToNull((void **) &pr->vars); */
+/* setToNull((void *) &pr->vars); */
/* pr->vars = newHashTable(100); */
/* for all the lines defined in the rule */
if (options.peep_file)
{
readRules (s = readFileIntoBuffer (options.peep_file));
- setToNull ((void **) &s);
+ setToNull ((void *) &s);
}