Better estimate of ediv register requirements in sucomp() -- a function call
authorDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 20 Feb 1988 17:46:38 +0000 (09:46 -0800)
committerDonn Seeley <donn@ucbvax.Berkeley.EDU>
Sat, 20 Feb 1988 17:46:38 +0000 (09:46 -0800)
in the right operand failed to force a store.

SCCS-vsn: old/pcc/ccom.tahoe/order.c 1.6

usr/src/old/pcc/ccom.tahoe/order.c

index b722663..e9606f1 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)order.c    1.5 (Berkeley) %G%";
+static char sccsid[] = "@(#)order.c    1.6 (Berkeley) %G%";
 #endif
 
 # include "pass2.h"
 #endif
 
 # include "pass2.h"
@@ -144,7 +144,7 @@ sucomp( p ) register NODE *p; {
                        sul++;
                /* ediv uses more regs */
                if(o==ASG DIV && p->in.left->in.type==UNSIGNED || o==ASG MOD){
                        sul++;
                /* ediv uses more regs */
                if(o==ASG DIV && p->in.left->in.type==UNSIGNED || o==ASG MOD){
-                       p->in.su = max(max(sur,sul+(sur!=0)),4+(sul!=0)+(sur!=0));
+                       p->in.su = max(max(sul,(sul!=0)+2),sur+1);
                        return;
                        }
                p->in.su = max(sur,sul+1);
                        return;
                        }
                p->in.su = max(sur,sul+1);
@@ -177,7 +177,7 @@ sucomp( p ) register NODE *p; {
                if(p->in.left->in.type!=UNSIGNED)
                        break;
        case MOD:
                if(p->in.left->in.type!=UNSIGNED)
                        break;
        case MOD:
-               p->in.su = max(max(sul,sur+(sul!=0)),4+(sul!=0)+(sur!=0));
+               p->in.su = max(max(sul,(sul!=0)+2),sur+1);
                return;
                }
        /* binary op, computed by left, then right, then do op */
                return;
                }
        /* binary op, computed by left, then right, then do op */