]> Cypherpunks repositories - gostls13.git/commitdiff
another both sides functions
authorKen Thompson <ken@golang.org>
Sat, 28 Jun 2008 00:53:23 +0000 (17:53 -0700)
committerKen Thompson <ken@golang.org>
Sat, 28 Jun 2008 00:53:23 +0000 (17:53 -0700)
SVN=125230

src/cmd/6g/cgen.c
src/cmd/6g/gen.c

index c0e685318d1ed4461d4cb3d162a2c98c99f26358..b8c49b4f928ff421a4eaa165966211bddf0e151d 100644 (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);
index 36e0ea90607d5bca03a80e1e860d8dc918c8f78e..f4b8652f6a17b8af45fba25287460ad6f9fca25b 100644 (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: