file reorg, pathnames.h, paths.h
[unix-history] / usr / src / old / pcc / c2.tahoe / c22.c
index 75a3fbc..642b51a 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)c22.c      1.6 (Berkeley/CCI) %G%";
+static char sccsid[] = "@(#)c22.c      1.9 (Berkeley/CCI) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -34,7 +34,7 @@ rmove()
                repladdr(p);
                r = isreg(regs[RT1]);
                r1 = isreg(regs[RT2]);
                repladdr(p);
                r = isreg(regs[RT1]);
                r1 = isreg(regs[RT2]);
-               dest(regs[RT2],p->subop, 1);
+               dest(regs[RT2],p->subop, p->op!=CVT || r<0);
                if (r>=0 && r1>=0) {
                        p->op = MOV; p->subop = LONG;
                        p->pop = 0;
                if (r>=0 && r1>=0) {
                        p->op = MOV; p->subop = LONG;
                        p->pop = 0;
@@ -331,8 +331,16 @@ register struct node *p1, *p2;
 
        if (p1->op != p2->op || p1->subop != p2->subop)
                return(0);
 
        if (p1->op != p2->op || p1->subop != p2->subop)
                return(0);
+       if (p1->op == NIL && p1->subop == 0 && p1->pop != p2->pop)
+               return(0);
        if (p1->op != NIL && ord(p1->op) < ord(MOV))
                return(0);
        if (p1->op != NIL && ord(p1->op) < ord(MOV))
                return(0);
+       switch (p1->op) {
+       case EROU:      case JSW:       case TEXT:      case DATA:
+       case BSS:       case ALIGN:     case WGEN:      case END:
+               /* sufficient? */
+               return(0);
+       }
        if (p1->op==MOVA && p1->labno!=p2->labno) return(0);
        cp1 = p1->code;
        cp2 = p2->code;
        if (p1->op==MOVA && p1->labno!=p2->labno) return(0);
        cp1 = p1->code;
        cp2 = p2->code;
@@ -592,6 +600,7 @@ register struct node *p;
        } else if (p1->op==TST && equstr(regs[RT1],ccloc+1) &&
                        equtype(ccloc[0],p1->subop)) {
                p1=insertl(p1->forw); decref(p->ref); p->ref=p1; 
        } else if (p1->op==TST && equstr(regs[RT1],ccloc+1) &&
                        equtype(ccloc[0],p1->subop)) {
                p1=insertl(p1->forw); decref(p->ref); p->ref=p1; 
+               p->labno=p1->labno;
                nrtst++; nchange++;
        }
 }
                nrtst++; nchange++;
        }
 }