]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/58712 (issues found by --enable-checking=valgrind)
authorRichard Biener <rguenther@suse.de>
Mon, 14 Oct 2013 09:24:36 +0000 (09:24 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 14 Oct 2013 09:24:36 +0000 (09:24 +0000)
2013-10-14  Richard Biener  <rguenther@suse.de>

PR middle-end/58712
PR middle-end/55358
* gimple.c (iterative_hash_canonical_type): Make sure to
record the hash into the correct hashtable slot.

From-SVN: r203517

gcc/ChangeLog
gcc/gimple.c

index 2f0bfcec36393fe7876726a5ea817a18b7429c81..821cec2066bf2fc26430c5268fabf6571e4b07ff 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-14  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/58712
+       PR middle-end/55358
+       * gimple.c (iterative_hash_canonical_type): Make sure to
+       record the hash into the correct hashtable slot.
+
 2013-10-13  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR rtl-optimization/58662
index f3191aa749a86d93f7e02d4fb1c4423db1235dd6..e0cc4ef92d1a18ebbeeae02d046c2e81a3db8795 100644 (file)
@@ -3112,8 +3112,7 @@ iterative_hash_canonical_type (tree type, hashval_t val)
   struct tree_int_map *mp, m;
 
   m.base.from = type;
-  if ((slot = htab_find_slot (canonical_type_hash_cache, &m, INSERT))
-      && *slot)
+  if ((slot = htab_find_slot (canonical_type_hash_cache, &m, NO_INSERT)))
     return iterative_hash_hashval_t (((struct tree_int_map *) *slot)->to, val);
 
   /* Combine a few common features of types so that types are grouped into
@@ -3217,6 +3216,10 @@ iterative_hash_canonical_type (tree type, hashval_t val)
   mp = ggc_alloc_cleared_tree_int_map ();
   mp->base.from = type;
   mp->to = v;
+  /* As we recurse the hashtable may expand between looking up the
+     cached value (and not finding one) and here, so we have to
+     re-lookup the slot.  */
+  slot = htab_find_slot (canonical_type_hash_cache, &m, INSERT);
   *slot = (void *) mp;
 
   return iterative_hash_hashval_t (v, val);