bitVectDebugOn (ebbs[i]->ldefs, of);
fprintf (of, "\npointers Set bitvector :");
bitVectDebugOn (ebbs[i]->ptrsSet, of);
+#if 0
+ fprintf (of, "\nin coming definitions :");
+ bitVectDebugOn (ebbs[i]->inDefs, of);
+ fprintf (of, "\nout going definitions :");
+ bitVectDebugOn (ebbs[i]->outDefs, of);
+ fprintf (of, "\ndefines used :");
+ bitVectDebugOn (ebbs[i]->usesDefs, of);
+#endif
+
if (ebbs[i]->isLastInLoop) {
fprintf (of, "\nInductions Set bitvector :");
bitVectDebugOn (ebbs[i]->linds, of);
/* if this is true then we put it before the condition else */
/* we put it before if, this is to reduce register pressure, */
/* we don't have to hold condition too long in a register */
- if (ebp->ech->op == IFX)
+
+ /* loop induction sometimes appends a GOTO instruction, */
+ /* it must be at the very end */
+ if (ebp->ech->op == IFX && ic->op != GOTO)
{
iCode *ipoint;
iCode *loop = ic;
ebbIndex *ebbi;
- ebbi = Safe_alloc (sizeof (ebbIndex *));
+ ebbi = Safe_alloc (sizeof (ebbIndex));
ebbi->count = 0;
ebbi->dfOrder = NULL; /* no depth first order information yet */
/* allocate for the first entry */
- ebbs = Safe_alloc (sizeof (eBBlock **));
+ ebbs = Safe_alloc (sizeof (eBBlock *));
ebbi->bbOrder = ebbs;
while (loop)
/* allocate for the next one. Remember to clear the new */
/* pointer at the end, that was created by realloc. */
- ebbs = Safe_realloc (ebbs, (ebbi->count + 1) * sizeof (eBBlock **));
+ ebbs = Safe_realloc (ebbs, (ebbi->count + 1) * sizeof (eBBlock *));
ebbi->bbOrder = ebbs;
ebbs[ebbi->count] = 0;
otherPathsPresent (ebbs, destBlock))
{
- symbol *preHeaderLabel = newiTempPreheaderLabel ();
+ symbol *preHeaderLabel = newiTempLoopHeaderLabel (1);
int i, j;
eBBlock *pBlock;
/* if we have stopped at the block , allocate for an extra one */
- ebbs = Safe_realloc (ebbs, (ebbi->count + 1) * sizeof (eBBlock **));
+ ebbs = Safe_realloc (ebbs, (ebbi->count + 1) * sizeof (eBBlock *));
ebbi->bbOrder = ebbs;
ebbs[ebbi->count] = 0;