]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] 6g: don't create variables for indirect addresses
authorAustin Clements <austin@google.com>
Wed, 5 Nov 2014 20:36:47 +0000 (15:36 -0500)
committerAustin Clements <austin@google.com>
Wed, 5 Nov 2014 20:36:47 +0000 (15:36 -0500)
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

index 8d600d64336afd09364977a7efdbbcb60c564949..afd3f1056e580589f87100a4d28b7eba8225e5b6 100644 (file)
@@ -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);