]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.power64] 5g: fix mistaken bit-wise AND in regopt
authorAustin Clements <austin@google.com>
Fri, 7 Nov 2014 15:43:55 +0000 (10:43 -0500)
committerAustin Clements <austin@google.com>
Fri, 7 Nov 2014 15:43:55 +0000 (10:43 -0500)
Replace a bit-wise AND with a logical one.  This happened to
work before because bany returns 0 or 1, but the intent here
is clearly logical (and this makes 5g match with 6g and 8g).

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/172850043

src/cmd/5g/reg.c

index 5b25adaf45b6c16282eac85a1a7436214d64d92e..712841329edb8f49ee01354d58f1cd74585ef5a3 100644 (file)
@@ -393,7 +393,7 @@ loop2:
                for(z=0; z<BITS; z++)
                        bit.b[z] = (r->refahead.b[z] | r->calahead.b[z]) &
                          ~(externs.b[z] | params.b[z] | addrs.b[z] | consts.b[z]);
-               if(bany(&bit) & !r->f.refset) {
+               if(bany(&bit) && !r->f.refset) {
                        // should never happen - all variables are preset
                        if(debug['w'])
                                print("%L: used and not set: %Q\n", r->f.prog->lineno, bit);