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

View file

@ -746,7 +746,12 @@ cgen_asop(Node *n)
nr = n->right;
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) {
@ -881,9 +886,6 @@ cgen_as(Node *nl, Node *nr, int op)
ullmancalc(nr);
}
if(nr->ullman >= UINF && nl->ullman >= UINF) {
fatal("cgen_as both sides call");
}
cgen(nr, nl);
ret: