]> Cypherpunks repositories - gostls13.git/commitdiff
change minimum sethi/ullman number to 1
authorRuss Cox <rsc@golang.org>
Thu, 6 Nov 2008 22:50:58 +0000 (14:50 -0800)
committerRuss Cox <rsc@golang.org>
Thu, 6 Nov 2008 22:50:58 +0000 (14:50 -0800)
to distinguish not computed (0) vs trivial (1).

add missing ullmancalc on function args.

R=ken
OCL=18711
CL=18711

src/cmd/6g/gen.c
src/cmd/6g/gsubr.c
src/cmd/gc/dcl.c
src/cmd/gc/subr.c
src/cmd/gc/walk.c

index 633c325ddfac9e4e85eae16c6f945cc26c8f8367..1b4c7e6645dbd8c9f69db74fb7d0832b76cb6c77 100644 (file)
@@ -28,7 +28,7 @@ if(newproc == N) {
        newproc->sym = pkglookup("newproc", "sys");
        newproc->class = PEXTERN;
        newproc->addable = 1;
-       newproc->ullman = 0;
+       newproc->ullman = 1;
 }
 
 if(throwindex == N) {
@@ -36,7 +36,7 @@ if(throwindex == N) {
        throwindex->sym = pkglookup("throwindex", "sys");
        throwindex->class = PEXTERN;
        throwindex->addable = 1;
-       throwindex->ullman = 0;
+       throwindex->ullman = 1;
 }
 
 if(throwreturn == N) {
@@ -44,7 +44,7 @@ if(throwreturn == N) {
        throwreturn->sym = pkglookup("throwreturn", "sys");
        throwreturn->class = PEXTERN;
        throwreturn->addable = 1;
-       throwreturn->ullman = 0;
+       throwreturn->ullman = 1;
 }
 
        if(fn->nbody == N)
index 3114eab27d7977b11396ce86003d4916cdbc9aa8..7ca619cc2081bc787a256739d15570f8e14352db 100644 (file)
@@ -1640,7 +1640,7 @@ tempname(Node *n, Type *t)
        n->etype = t->etype;
        n->class = PAUTO;
        n->addable = 1;
-       n->ullman = 0;
+       n->ullman = 1;
 
        dowidth(t);
        w = t->width;
index 3fb7710195e692713c94a1dca9f059396512fd6b..effb957858d92e7e054c74cb2b374f54751608cf 100644 (file)
@@ -865,7 +865,7 @@ newname(Sym *s)
        n->sym = s;
        n->type = T;
        n->addable = 1;
-       n->ullman = 0;
+       n->ullman = 1;
        return n;
 }
 
@@ -886,7 +886,7 @@ oldname(Sym *s)
                n->sym = s;
                n->type = T;
                n->addable = 1;
-               n->ullman = 0;
+               n->ullman = 1;
        }
        return n;
 }
index ddf0560c3843a510c0129592f1100bdf68f319bf..2e81078857a0659fa03057edbde3b5fdaa4f5bd1 100644 (file)
@@ -2048,7 +2048,7 @@ ullmancalc(Node *n)
        switch(n->op) {
        case OLITERAL:
        case ONAME:
-               ul = 0;
+               ul = 1;
                goto out;
        case OCALL:
        case OCALLMETH:
@@ -2056,10 +2056,10 @@ ullmancalc(Node *n)
                ul = UINF;
                goto out;
        }
-       ul = 0;
+       ul = 1;
        if(n->left != N)
                ul = n->left->ullman;
-       ur = 0;
+       ur = 1;
        if(n->right != N)
                ur = n->right->ullman;
        if(ul == ur)
index 42eb037e74dd32f7f0d5fa6cfb43b65167980414..13ad69a65adab42f6ba7fae1a497495bc6cfd429 100644 (file)
@@ -3053,6 +3053,7 @@ loop1:
                fatal("reorder1 OLIST");
 
        t++;
+       ullmancalc(l);
        if(l->ullman >= UINF)
                c++;
        l = listnext(&save);
@@ -3072,6 +3073,7 @@ loop2:
                r = list(f, r);
                return r;
        }
+       ullmancalc(l);
        if(l->ullman < UINF) {
                r = list(l, r);
                goto more;
@@ -3123,6 +3125,7 @@ loop1:
        if(l->op == OLIST)
                fatal("reorder2 OLIST");
 
+       ullmancalc(l);
        if(l->ullman >= UINF)
                c++;
        l = listnext(&save);