same as https://golang.org/cl/152088
in more files.
Fixes #83.
R=r, r1
https://golang.org/cl/152091
h += *p++;
}
n = (p - symb) + 1;
- if((int32)h < 0)
- h = ~h;
+ h &= 0xffffff;
h %= NHASH;
c = symb[0];
for(s = hash[h]; s != S; s = s->link) {
h = 0;
for(cp = name; *cp; h += *cp++)
h *= 1119;
- if(h < 0)
- h = ~h;
+ // not if(h < 0) h = ~h, because gcc 4.3 -O2 miscompiles it.
+ h &= 0xffffff;
return h;
}
for(p=symb; c = *p; p++)
h = h+h+h + c;
l = (p - symb) + 1;
- if(h < 0)
- h = ~h;
+ // not if(h < 0) h = ~h, because gcc 4.3 -O2 miscompiles it.
+ h &= 0xffffff;
h %= NHASH;
for(s = hash[h]; s != S; s = s->link)
if(s->version == v)