another both sides functions

SVN=125230
This commit is contained in:
Ken Thompson 2008-06-27 17:53:23 -07:00
parent 57d80398e6
commit ca029d34b6
2 changed files with 11 additions and 7 deletions

View File

@ -29,8 +29,10 @@ cgen(Node *n, Node *res)
if(n->op == OINDREG) if(n->op == OINDREG)
fatal("cgen: this is going to misscompile"); fatal("cgen: this is going to misscompile");
if(res->ullman >= UINF) { if(res->ullman >= UINF) {
dump("fncalls", n); tempname(&n1, n->type);
fatal("cgen: node and result functions"); cgen(n, &n1);
cgen(&n1, res);
goto ret;
} }
} }
@ -45,7 +47,7 @@ cgen(Node *n, Node *res)
cgen(n, &n1); cgen(n, &n1);
cgen(&n1, res); cgen(&n1, res);
regfree(&n1); regfree(&n1);
return; goto ret;
} }
igen(res, &n1, N); igen(res, &n1, N);

View File

@ -746,7 +746,12 @@ cgen_asop(Node *n)
nr = n->right; nr = n->right;
if(nr->ullman >= UINF && nl->ullman >= UINF) { if(nr->ullman >= UINF && nl->ullman >= UINF) {
fatal("cgen_asop: both sides call"); tempname(&n1, nr->type);
cgen(nr, &n1);
n2 = *n;
n2.right = &n1;
cgen_asop(&n2);
return;
} }
if(nr->ullman > nl->ullman) { if(nr->ullman > nl->ullman) {
@ -881,9 +886,6 @@ cgen_as(Node *nl, Node *nr, int op)
ullmancalc(nr); ullmancalc(nr);
} }
if(nr->ullman >= UINF && nl->ullman >= UINF) {
fatal("cgen_as both sides call");
}
cgen(nr, nl); cgen(nr, nl);
ret: ret: