@@ -2695,18 +2695,22 @@ hashval_t
bitmap_hash (const_bitmap head)
{
const bitmap_element *ptr;
- BITMAP_WORD hash = 0;
+ hashval_t hash = 0;
int ix;
gcc_checking_assert (!head->tree_form);
for (ptr = head->first; ptr; ptr = ptr->next)
{
- hash ^= ptr->indx;
+ hash = iterative_hash_hashval_t (ptr->indx, hash);
+ BITMAP_WORD bits = 0;
for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
- hash ^= ptr->bits[ix];
+ bits ^= ptr->bits[ix];
+ if (sizeof (bits) == 8 && sizeof (hashval_t) == 4)
+ bits ^= bits >> 32;
+ hash ^= (hashval_t)bits;
}
- return iterative_hash (&hash, sizeof (hash), 0);
+ return hash;
}