diff --git a/src/cmd/8c/cgen.c b/src/cmd/8c/cgen.c index 0d147b02fa..edb29ad8c7 100644 --- a/src/cmd/8c/cgen.c +++ b/src/cmd/8c/cgen.c @@ -55,6 +55,12 @@ cgen(Node *n, Node *nn) l = n->left; r = n->right; o = n->op; + + if(n->op == OEXREG || (nn != Z && nn->op == OEXREG)) { + gmove(n, nn); + return; + } + if(n->addable >= INDEXED) { if(nn == Z) { switch(o) { diff --git a/src/cmd/8c/sgen.c b/src/cmd/8c/sgen.c index c143c9a800..c4f91987ca 100644 --- a/src/cmd/8c/sgen.c +++ b/src/cmd/8c/sgen.c @@ -98,6 +98,7 @@ indexshift(Node *n) * (20) * (X) ==> 7 multiplier in indexing * (X,7) + (13,1) ==> 8 adder in indexing (addresses) * (8) ==> &9(OINDEX) index, almost addressable + * 100 extern register * * calculate complexity (number of registers) */ @@ -125,7 +126,7 @@ xcom(Node *n) break; case OEXREG: - n->addable = 10; + n->addable = 0; break; case OREGISTER: