1
0
mirror of https://github.com/golang/go synced 2024-11-25 07:17:56 -07:00

arm register allocation/tempname allocation bug

R=r
CC=golang-dev
https://golang.org/cl/4008044
This commit is contained in:
Ken Thompson 2011-01-18 20:45:17 -08:00
parent 9b6d8b3c4f
commit eead5e8879

View File

@ -567,7 +567,8 @@ agen(Node *n, Node *res)
regalloc(&n1, tmp.type, N); regalloc(&n1, tmp.type, N);
gmove(&tmp, &n1); gmove(&tmp, &n1);
} }
} else if(nl->addable) { } else
if(nl->addable) {
if(!isconst(nr, CTINT)) { if(!isconst(nr, CTINT)) {
tempname(&tmp, types[TINT32]); tempname(&tmp, types[TINT32]);
p2 = cgenindex(nr, &tmp); p2 = cgenindex(nr, &tmp);
@ -1092,11 +1093,17 @@ bgen(Node *n, int true, Prog *to)
break; break;
} }
tempname(&n3, nl->type);
cgen(nl, &n3);
tempname(&tmp, nr->type);
cgen(nr, &tmp);
regalloc(&n1, nl->type, N); regalloc(&n1, nl->type, N);
cgen(nl, &n1); gmove(&n3, &n1);
regalloc(&n2, nr->type, N); regalloc(&n2, nr->type, N);
cgen(nr, &n2); gmove(&tmp, &n2);
gcmp(optoas(OCMP, nr->type), &n1, &n2); gcmp(optoas(OCMP, nr->type), &n1, &n2);
if(isfloat[nl->type->etype]) { if(isfloat[nl->type->etype]) {
@ -1109,7 +1116,6 @@ bgen(Node *n, int true, Prog *to)
} else { } else {
patch(gbranch(a, nr->type), to); patch(gbranch(a, nr->type), to);
} }
regfree(&n1); regfree(&n1);
regfree(&n2); regfree(&n2);
break; break;