1
0
mirror of https://github.com/golang/go synced 2024-11-19 12:34:47 -07:00

[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
This commit is contained in:
Austin Clements 2014-11-05 15:36:47 -05:00
parent fa32e922d5
commit 4f81684f86

View File

@ -621,6 +621,9 @@ mkvar(Reg *r, Adr *a)
if(r != R) if(r != R)
r->use1.b[0] |= doregbits(a->index); r->use1.b[0] |= doregbits(a->index);
if(t >= D_INDIR && t < 2*D_INDIR)
goto none;
switch(t) { switch(t) {
default: default:
regu = doregbits(t); regu = doregbits(t);