Commit 62be24d9 authored by Ken Thompson's avatar Ken Thompson

6g code gen bug

R=rsc
https://golang.org/cl/166052
parent f3d63bea
...@@ -80,8 +80,9 @@ compile(Node *fn) ...@@ -80,8 +80,9 @@ compile(Node *fn)
pc->as = ARET; // overwrite AEND pc->as = ARET; // overwrite AEND
pc->lineno = lineno; pc->lineno = lineno;
if(!debug['N'] || debug['R'] || debug['P']) if(!debug['N'] || debug['R'] || debug['P']) {
regopt(ptxt); regopt(ptxt);
}
// fill in argument size // fill in argument size
ptxt->to.offset = rnd(curfn->type->argwid, maxround); ptxt->to.offset = rnd(curfn->type->argwid, maxround);
......
...@@ -80,7 +80,6 @@ compile(Node *fn) ...@@ -80,7 +80,6 @@ compile(Node *fn)
pc->as = ARET; // overwrite AEND pc->as = ARET; // overwrite AEND
pc->lineno = lineno; pc->lineno = lineno;
if(0)
if(!debug['N'] || debug['R'] || debug['P']) { if(!debug['N'] || debug['R'] || debug['P']) {
regopt(ptxt); regopt(ptxt);
} }
...@@ -470,15 +469,10 @@ cgen_asop(Node *n) ...@@ -470,15 +469,10 @@ cgen_asop(Node *n)
} }
hard: hard:
if(nr->ullman > nl->ullman) {
tempname(&n2, nr->type); tempname(&n2, nr->type);
cgen(nr, &n2); cgen(nr, &n2);
igen(nl, &n1, N); igen(nl, &n1, N);
} else {
igen(nl, &n1, N);
tempname(&n2, nr->type);
cgen(nr, &n2);
}
n3 = *n; n3 = *n;
n3.left = &n1; n3.left = &n1;
......
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