if(testreg && (testreg->rIdx == reg->rIdx)) {
return 1;
}
+ if (i++ > 1000) {
+ fprintf(stderr, "warning, regUsedinRange searched through too many pcodes\n");
+ return 0;
+ }
pc1 = findNextInstruction(pc1->next);
- } while (pc1 && (pc1 != pc2) && (i++ < 100)) ;
-
- if(i >= 100)
- fprintf(stderr, "warning, regUsedinRange searched through too many pcodes\n");
+ } while (pc1 && (pc1 != pc2)) ;
return 0;
}
total_registers_saved++; // debugging stats.
}
- /* Note this else if is same conditional as the if - DELETE ME
- } else if ( (PCI(pct1)->op == POC_MOVWF) &&
- (PCI(pc2)->op == POC_MOVFW)) {
- DFPRINTF(stderr, " optimising MOVF reg1,W MOVWF reg ... MOVF reg,W\n");
- if(optimize_level > 1 && can_free) {
- pct2 = newpCode(POC_MOVFW, PCI(pc1)->pcop);
- pCodeInsertAfter(pc2, pct2);
- Remove2pcodes(pcfl_used, pc1, pc2, reg, 1);
- total_registers_saved++; // debugging stats.
- }
- */
}
}
}