Commit 3e5a817d authored by Kai Backman's avatar Kai Backman

a few more code generation bugs and an interface alignment issue.

go/test: passes 74% (251/339)

R=rsc
APPROVED=rsc
DELTA=40  (34 added, 0 deleted, 6 changed)
OCL=35254
CL=35275
parent 032f2d39
......@@ -604,7 +604,14 @@ agen(Node *n, Node *res)
cgen(n->heapaddr, res);
if(n->xoffset != 0) {
nodconst(&n1, types[TINT32], n->xoffset);
gins(optoas(OADD, types[tptr]), &n1, res);
regalloc(&n2, n1.type, N);
regalloc(&n3, types[TINT32], N);
gmove(&n1, &n2);
gmove(res, &n3);
gins(optoas(OADD, types[tptr]), &n2, &n3);
gmove(&n3, res);
regfree(&n2);
regfree(&n3);
}
break;
......@@ -616,7 +623,14 @@ agen(Node *n, Node *res)
agen(nl, res);
if(n->xoffset != 0) {
nodconst(&n1, types[TINT32], n->xoffset);
gins(optoas(OADD, types[tptr]), &n1, res);
regalloc(&n2, n1.type, N);
regalloc(&n3, types[TINT32], N);
gmove(&n1, &n2);
gmove(res, &n3);
gins(optoas(OADD, types[tptr]), &n2, &n3);
gmove(&n3, res);
regfree(&n2);
regfree(&n3);
}
break;
......@@ -624,7 +638,14 @@ agen(Node *n, Node *res)
cgen(nl, res);
if(n->xoffset != 0) {
nodconst(&n1, types[TINT32], n->xoffset);
gins(optoas(OADD, types[tptr]), &n1, res);
regalloc(&n2, n1.type, N);
regalloc(&n3, types[tptr], N);
gmove(&n1, &n2);
gmove(res, &n3);
gins(optoas(OADD, types[tptr]), &n2, &n3);
gmove(&n3, res);
regfree(&n2);
regfree(&n3);
}
break;
}
......
......@@ -211,13 +211,14 @@ cgen_callinter(Node *n, Node *res, int proc)
agen(i, &nodr); // REG = &inter
nodindreg(&nodsp, types[tptr], REGSP);
nodsp.xoffset = 4;
nodo.xoffset += widthptr;
cgen(&nodo, &nodsp); // 0(SP) = 8(REG) -- i.s
cgen(&nodo, &nodsp); // 4(SP) = 8(REG) -- i.s
nodo.xoffset -= widthptr;
cgen(&nodo, &nodr); // REG = 0(REG) -- i.m
nodo.xoffset = n->left->xoffset + 4*widthptr;
nodo.xoffset = n->left->xoffset + 3*widthptr + 8;
cgen(&nodo, &nodr); // REG = 32+offset(REG) -- i.m->fun[f]
// BOTCH nodr.type = fntype;
......
......@@ -712,7 +712,10 @@ gmove(Node *f, Node *t)
case CASE(TUINT32, TUINT64):
split64(t, &tlo, &thi);
gmove(f, &tlo);
gins(AMOVW, ncon(0), &thi);
regalloc(&r1, thi.type, N);
gins(AMOVW, ncon(0), &r1);
gins(AMOVW, &r1, &thi);
regfree(&r1);
splitclean();
return;
......
......@@ -2,6 +2,7 @@
assign.go
blank1.go
bugs/bug136.go
bugs/bug162.go
bugs/bug169.go
bugs/bug190.go
bugs/bug193.go
......@@ -203,30 +204,38 @@ indirect.go
indirect1.go
initcomma.go
initializerr.go
interface/convert.go
interface/convert1.go
interface/convert2.go
interface/explicit.go
interface/fail.go
interface/pointer.go
interface/receiver.go
interface/receiver1.go
interface/recursive.go
interface/returntype.go
interface/struct.go
iota.go
ken/complit.go
ken/embed.go
ken/for.go
ken/interfun.go
ken/intervar.go
ken/label.go
ken/mfunc.go
ken/ptrvar.go
ken/rob1.go
ken/rob2.go
ken/robfor.go
ken/robif.go
ken/shift.go
ken/simpbool.go
ken/simpfun.go
ken/simpprint.go
ken/simpswitch.go
ken/simpvar.go
ken/strvar.go
method.go
method1.go
method2.go
method3.go
......
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