BSD 4_4 release
[unix-history] / usr / src / old / pcc / mip / reader.c
index c71fcfa..e84339a 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid ="@(#)reader.c     4.5 (Berkeley) %G%";
+static char *sccsid ="@(#)reader.c     4.8 (Berkeley) 12/10/87";
 #endif lint
 
 # include "pass2.h"
 #endif lint
 
 # include "pass2.h"
@@ -212,9 +212,6 @@ mainp2( argc, argv ) char *argv[]; {
                tcheck();
                continue;
 
                tcheck();
                continue;
 
-       default:
-               cerror( "intermediate file format error" );
-
                }
 
        /* EOF */
                }
 
        /* EOF */
@@ -459,12 +456,12 @@ prcook( cookie ){
 
 int odebug = 0;
 
 
 int odebug = 0;
 
-order(p,cook) NODE *p; {
+order(p,cook) register NODE *p; {
 
        register o, ty, m;
        int m1;
        int cookie;
 
        register o, ty, m;
        int m1;
        int cookie;
-       NODE *p1, *p2;
+       register NODE *p1, *p2;
 
        cookie = cook;
        rcount();
 
        cookie = cook;
        rcount();
@@ -617,11 +614,7 @@ order(p,cook) NODE *p; {
                        }
 
        case UNARY MINUS:
                        }
 
        case UNARY MINUS:
-#if defined(tahoe)
                order( p1, INBREG|INAREG|SOREG );
                order( p1, INBREG|INAREG|SOREG );
-#else
-               order( p1, INBREG|INAREG );
-#endif
                goto again;
 
        case NAME:
                goto again;
 
        case NAME:
@@ -665,6 +658,22 @@ order(p,cook) NODE *p; {
                        p->in.op = FREE;
                        return;
                        }
                        p->in.op = FREE;
                        return;
                        }
+#ifdef R2REGS
+               /* try to coax a tree into a doubly indexed OREG */
+               p1 = p->in.left;
+               if( p1->in.op == PLUS ) {
+                       if( ISPTR(p1->in.left->in.type) &&
+                           offset(p1->in.right, tlen(p)) >= 0 ) {
+                               order( p1->in.left, INAREG|INTAREG );
+                               goto again;
+                               }
+                       if( ISPTR(p1->in.right->in.type) &&
+                           offset(p1->in.left, tlen(p)) >= 0 ) {
+                               order( p1->in.right, INAREG|INTAREG );
+                               goto again;
+                               }
+                       }
+#endif
                offstar( p->in.left );
                goto again;
 
                offstar( p->in.left );
                goto again;