aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-11-07 10:43:55 -0500
committerAustin Clements <austin@google.com>2014-11-07 10:43:55 -0500
commit7739533f61616ba71ef691489c0eeab2a59bd9e9 (patch)
tree842df71eb53a01e06b1334552862859a47891f6e
parente156f0e9971ca77ed6f9cb34e36ed73145bfa177 (diff)
downloadgo-7739533f61616ba71ef691489c0eeab2a59bd9e9.tar.gz
go-7739533f61616ba71ef691489c0eeab2a59bd9e9.zip
[dev.power64] 5g: fix mistaken bit-wise AND in regopt
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
-rw-r--r--src/cmd/5g/reg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c
index 5b25adaf45..712841329e 100644
--- a/src/cmd/5g/reg.c
+++ b/src/cmd/5g/reg.c
@@ -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);