]> Cypherpunks repositories - gostls13.git/commitdiff
6g code gen bug
authorKen Thompson <ken@golang.org>
Fri, 4 Dec 2009 04:28:24 +0000 (20:28 -0800)
committerKen Thompson <ken@golang.org>
Fri, 4 Dec 2009 04:28:24 +0000 (20:28 -0800)
R=rsc
https://golang.org/cl/166052

src/cmd/6g/ggen.c
src/cmd/8g/ggen.c

index cf5614861675d60f124d109d9517ebbc625a19ec..5b42d0f1ae09b98fe1a73d76f3564fe844b2bfe0 100644 (file)
@@ -80,8 +80,9 @@ compile(Node *fn)
        pc->as = ARET;  // overwrite AEND
        pc->lineno = lineno;
 
-       if(!debug['N'] || debug['R'] || debug['P'])
+       if(!debug['N'] || debug['R'] || debug['P']) {
                regopt(ptxt);
+       }
 
        // fill in argument size
        ptxt->to.offset = rnd(curfn->type->argwid, maxround);
index 8ec8d9ba27def0cd6f2ff9ec790c0d13da5f0078..2e8837267ceb6a3962fb5737f06f0d920770c7d9 100644 (file)
@@ -80,7 +80,6 @@ compile(Node *fn)
        pc->as = ARET;  // overwrite AEND
        pc->lineno = lineno;
 
-if(0)
        if(!debug['N'] || debug['R'] || debug['P']) {
                regopt(ptxt);
        }
@@ -470,15 +469,10 @@ cgen_asop(Node *n)
        }
 
 hard:
-       if(nr->ullman > nl->ullman) {
-               tempname(&n2, nr->type);
-               cgen(nr, &n2);
-               igen(nl, &n1, N);
-       } else {
-               igen(nl, &n1, N);
-               tempname(&n2, nr->type);
-               cgen(nr, &n2);
-       }
+       tempname(&n2, nr->type);
+       cgen(nr, &n2);
+
+       igen(nl, &n1, N);
 
        n3 = *n;
        n3.left = &n1;