doreturn:
#ifdef ALLOW_NEXTEM
if (toplevel && totalcost == INFINITY && ! paniced) {
+ DEBUG("PANIC!");
totalcost += stackupto(&fakestack[stackheight-1], ply, toplevel);
+#ifndef NDEBUG
+ if (Debug > 2)
+ fprintf(stderr, "Stackheight = %d\n", stackheight);
+#endif
paniced = 1;
- DEBUG("PANIC!");
+ tokpatlen = 0;
goto panic;
}
#endif
* First compute equivalence classes of registers.
*/
- for (i=0;i<NREGS;i++) {
+ for (i=NREGS;--i>=0;) {
regclass[i] = class++;
if (getrefcount(i, FALSE) == 0) {
- for (j=0;j<i;j++) {
+ for (j=NREGS;--j>i;) {
if (eqregclass(i,j) &&
eqtoken(&machregs[i].r_contents,
&machregs[j].r_contents)) {
perms = pp;
} else {
rlp=lar[index];
- for (i=rlp->rl_n-1; i>=0; i--) {
- rar[index] = rlp->rl_list[i];
+ for (i=rlp->rl_n; i>0; i--) {
+ rar[index] = rlp->rl_list[rlp->rl_n-i];
permute(index+1);
}
}
} else
exact++;
}
+ for (;i<tpl+fromstackneeded;i++) {
+ /* Make sure that any pattern we pick can be
+ made from the stack
+ */
+ getint(tokexp,bp);
+ if (! from_stack(&machsets[tokexp])) {
+ return(MAXINT);
+ }
+ }
if (exact==tpl && ! fromstackneeded) {
if (xsekt)
return(0);
return(20-2*exact+fromstackneeded);
}
+extern set_t unstackset;
+
+int from_stack(s1)
+ register set_p s1;
+{
+ register set_p s2 = &unstackset;
+ register int i;
+ for (i = 0; i < SETSIZE; i++) {
+ if ((s1->set_val[i] & s2->set_val[i]) != 0) return 1;
+ }
+ return 0;
+}
+
unsigned costcalc(cost) cost_t cost; {
extern unsigned cc1,cc2,cc3,cc4;