https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113910

--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> ---
The following still helps quite a bit on its own.

diff --git a/gcc/bitmap.cc b/gcc/bitmap.cc
index 459e32c1ad1..a05ad810800 100644
--- a/gcc/bitmap.cc
+++ b/gcc/bitmap.cc
@@ -2695,18 +2695,21 @@ 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);
       for (ix = 0; ix != BITMAP_ELEMENT_WORDS; ix++)
-       hash ^= ptr->bits[ix];
+       if (sizeof (BITMAP_WORD) > sizeof (hashval_t))
+         hash = iterative_hash_host_wide_int (ptr->bits[ix], hash);
+       else
+         hash = iterative_hash_hashval_t (ptr->bits[ix], hash);
     }
-  return iterative_hash (&hash, sizeof (hash), 0);
+  return hash;
 }

 ^L

Reply via email to