The following patch unbreaks PCH of the int_cst_hash_table where
we currently compute the hash mixing in the pointer value of a tree.
That for sure breaks with PCH.  An easy fix is to simply use TYPE_UID
instead of htab_hash_pointer.  But the hash is quite stupid at the
moment.  I guess using TYPE_UID won't make it worse and it's definitely
a safe bet for branches?

Bootstrap / regtest pending on x86_64-unknown-linux-gnu.

Any comments?

Thanks,
Richard.

2014-12-01  Richard Biener  <rguent...@suse.de>

        PR middle-end/64111
        * tree.c (int_cst_hasher::hash): Use TYPE_UID instead of
        htab_hash_pointer to not break PCH.

Index: gcc/tree.c
===================================================================
--- gcc/tree.c  (revision 218200)
+++ gcc/tree.c  (working copy)
@@ -1303,7 +1303,7 @@ hashval_t
 int_cst_hasher::hash (tree x)
 {
   const_tree const t = x;
-  hashval_t code = htab_hash_pointer (TREE_TYPE (t));
+  hashval_t code = TYPE_UID (TREE_TYPE (t));
   int i;
 
   for (i = 0; i < TREE_INT_CST_NUNITS (t); i++)

Reply via email to