diff options
author | Austin Clements <austin@google.com> | 2014-11-05 15:36:47 -0500 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2014-11-05 15:36:47 -0500 |
commit | 4f81684f8640e81b1c337a6b88488a888d13abea (patch) | |
tree | cab5decef8df04089ed6a2143b9ff6da934bbe74 | |
parent | fa32e922d54c2a2d4b9bb97009ac6e3c84af3dd6 (diff) | |
download | go-4f81684f8640e81b1c337a6b88488a888d13abea.tar.gz go-4f81684f8640e81b1c337a6b88488a888d13abea.zip |
[dev.power64] 6g: don't create variables for indirect addresses
Previously, mkvar treated, for example, 0(AX) the same as AX.
As a result, a move to an indirect address would be marked as
*setting* the register, rather than just using it, resulting
in unnecessary register moves. Fix this by not producing
variables for indirect addresses.
LGTM=rsc
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/164610043
-rw-r--r-- | src/cmd/6g/reg.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cmd/6g/reg.c b/src/cmd/6g/reg.c index 8d600d6433..afd3f1056e 100644 --- a/src/cmd/6g/reg.c +++ b/src/cmd/6g/reg.c @@ -621,6 +621,9 @@ mkvar(Reg *r, Adr *a) if(r != R) r->use1.b[0] |= doregbits(a->index); + if(t >= D_INDIR && t < 2*D_INDIR) + goto none; + switch(t) { default: regu = doregbits(t); |