7c: now really fix OASxxx operations
the previous patch broke 64-bit ops as the type for the operation is determined from the first argument to gopcode() (nod1.type), not the type the result (nod.type). so we need to include the conversion of nod1 type to the type of nod.front
parent
1d07c2a161
commit
4bbf1d12b5
|
@ -287,25 +287,28 @@ cgenrel(Node *n, Node *nn, int inrel)
|
||||||
reglcgen(&nod2, l, Z);
|
reglcgen(&nod2, l, Z);
|
||||||
else
|
else
|
||||||
nod2 = *l;
|
nod2 = *l;
|
||||||
regalloc(&nod, n, nn);
|
regalloc(&nod1, r, Z);
|
||||||
cgen(r, &nod);
|
cgen(r, &nod1);
|
||||||
} else {
|
} else {
|
||||||
regalloc(&nod, n, nn);
|
regalloc(&nod1, r, Z);
|
||||||
cgen(r, &nod);
|
cgen(r, &nod1);
|
||||||
if(l->addable < INDEXED)
|
if(l->addable < INDEXED)
|
||||||
reglcgen(&nod2, l, Z);
|
reglcgen(&nod2, l, Z);
|
||||||
else
|
else
|
||||||
nod2 = *l;
|
nod2 = *l;
|
||||||
}
|
}
|
||||||
regalloc(&nod1, n, Z);
|
if(nod1.type->etype == nod2.type->etype || !typefd[nod1.type->etype])
|
||||||
gopcode(OAS, &nod2, Z, &nod1);
|
regalloc(&nod, &nod2, nn);
|
||||||
|
else
|
||||||
|
regalloc(&nod, &nod1, Z);
|
||||||
|
gopcode(OAS, &nod2, Z, &nod);
|
||||||
if(nod1.type->etype != nod.type->etype){
|
if(nod1.type->etype != nod.type->etype){
|
||||||
regalloc(&nod3, &nod, Z);
|
regalloc(&nod3, &nod, Z);
|
||||||
gmove(&nod1, &nod3);
|
gmove(&nod1, &nod3);
|
||||||
regfree(&nod1);
|
regfree(&nod1);
|
||||||
nod1 = nod3;
|
nod1 = nod3;
|
||||||
}
|
}
|
||||||
gopcode(o, &nod, &nod1, &nod);
|
gopcode(o, &nod1, &nod, &nod);
|
||||||
gmove(&nod, &nod2);
|
gmove(&nod, &nod2);
|
||||||
if(nn != Z)
|
if(nn != Z)
|
||||||
gmove(&nod, nn);
|
gmove(&nod, nn);
|
||||||
|
|
Loading…
Reference in New Issue