Commit 0eda21a2 authored by Russ Cox's avatar Russ Cox

change minimum sethi/ullman number to 1

to distinguish not computed (0) vs trivial (1).

add missing ullmancalc on function args.

R=ken
OCL=18711
CL=18711
parent ce164403
......@@ -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)
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment