Commit e69f12ae authored by Russ Cox's avatar Russ Cox

two more if(h<0) that gcc 4.3 -O2 miscompiles

R=r
https://golang.org/cl/160044
parent b90f6732
......@@ -226,8 +226,7 @@ lookup(void)
for(p=symb; c = *p; p++)
h = h+h+h + c;
l = (p - symb) + 1;
if(h < 0)
h = ~h;
h &= 0xffffff;
h %= NHASH;
c = symb[0];
for(s = hash[h]; s != S; s = s->link) {
......
......@@ -257,9 +257,7 @@ objlookup(int id, char *name, int type, uint sig)
h = *name;
for(cp = name+1; *cp; h += *cp++)
h *= HASHMUL;
if(h < 0)
h = ~h;
h &= (NHASH-1);
h &= NHASH-1;
if (type == 'U' || type == 'b' || islocal(type)) {
for(sp = hash[h]; sp; sp = sp->next)
if(strcmp(sp->s.name, name) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment