From: rguenth Date: Mon, 14 Oct 2013 09:24:36 +0000 (+0000) Subject: 2013-10-14 Richard Biener X-Git-Tag: upstream/4.9.2~3715 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5c28cb53f9a5dd1172ba75799595210cb49f67b5;p=platform%2Fupstream%2Flinaro-gcc.git 2013-10-14 Richard Biener 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203517 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f0bfce..821cec2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-10-14 Richard Biener + + 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 PR rtl-optimization/58662 diff --git a/gcc/gimple.c b/gcc/gimple.c index f3191aa..e0cc4ef 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -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);