From 4f81684f8640e81b1c337a6b88488a888d13abea Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Wed, 5 Nov 2014 15:36:47 -0500 Subject: [PATCH] [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 --- src/cmd/6g/reg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/6g/reg.c b/src/cmd/6g/reg.c index 8d600d64336..afd3f1056e5 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);