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;
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;
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;
}
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;
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;