This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix parts of PR58712 / PR55358
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Oct 2013 11:26:14 +0200
- Subject: Re: [PATCH] Fix parts of PR58712 / PR55358
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LNX dot 2 dot 00 dot 1310141121540 dot 5598 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Oct 14, 2013 at 11:23:55AM +0200, Richard Biener wrote:
> --- gcc/gimple.c (revision 203409)
> +++ gcc/gimple.c (working copy)
> @@ -3112,8 +3112,7 @@ iterative_hash_canonical_type (tree type
> 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);
Why don't you use htab_find instead of htab_find_slot then?
>
> /* Combine a few common features of types so that types are grouped into
> @@ -3217,6 +3216,10 @@ iterative_hash_canonical_type (tree type
> 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);
Jakub