diff mbox

[RFC] Fix PR64111

Message ID alpine.LSU.2.11.1412011119270.5894@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Dec. 1, 2014, 10:23 a.m. UTC
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  <rguenther@suse.de>

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

Comments

Mike Stump Dec. 1, 2014, 12:32 p.m. UTC | #1
On Dec 1, 2014, at 2:23 AM, Richard Biener <rguenther@suse.de> wrote:
> The following patch unbreaks PCH

> Any comments?

Seems better to me.
diff mbox

Patch

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++)