Commit ca029d34 authored by Ken Thompson's avatar Ken Thompson

another both sides functions

SVN=125230
parent 57d80398
......@@ -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);
......
......@@ -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:
......
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