Patchwork Fix PR54704

login
register
mail settings
Submitter Richard Guenther
Date Sept. 25, 2012, 3:07 p.m.
Message ID <alpine.LNX.2.00.1209251706430.4063@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/186836/
State New
Headers show

Comments

Richard Guenther - Sept. 25, 2012, 3:07 p.m.
I am testing the following patch to fix a typo(?) in the hash
function for location ad-hoc data.  The current hash function
causes 1000 collisions for each search when building tramp3d.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

Richard.

2012-09-25  Richard Guenther  <rguenther@suse.de>

	PR middle-end/54704
	* line-map.c (location_adhoc_data_hash): Fix.

Patch

Index: libcpp/line-map.c
===================================================================
--- libcpp/line-map.c	(revision 191706)
+++ libcpp/line-map.c	(working copy)
@@ -58,7 +58,7 @@  location_adhoc_data_hash (const void *l)
 {
   const struct location_adhoc_data *lb =
       (const struct location_adhoc_data *) l;
-  return (hashval_t) lb->locus + (size_t) &lb->data;
+  return (hashval_t) lb->locus + (size_t) lb->data;
 }
 
 /* Compare function for location_adhoc_data hashtable.  */