Re: [PATCH] Remove class cache_map and use ggc hash_maps instead (PR c++/70452)

2016-04-04 Thread Jason Merrill
Oops, I should have read the followup. :) This one is OK, thanks. Jason

Re: [PATCH] Remove class cache_map and use ggc hash_maps instead (PR c++/70452)

2016-04-04 Thread Jason Merrill
On 04/04/2016 01:08 PM, Patrick Palka wrote: + tree *slot = &cv_cache->get_or_insert (t, NULL); + if (*slot == NULL_TREE) +*slot = maybe_constant_value_1 (t, decl); ... - fold_cache.put (org_x, x); + *slot = x; This pattern isn't safe; the slot might move due to hash table resizing b

Re: [PATCH] Remove class cache_map and use ggc hash_maps instead (PR c++/70452)

2016-04-04 Thread Patrick Palka
On Mon, 4 Apr 2016, Patrick Palka wrote: > On Mon, 4 Apr 2016, Jason Merrill wrote: > > > Hmm, I thought I remembered hitting the breakpoint in gt_cleare_cache and it > > being non-null. But I guess we can get rid of the cache_map class and use > > the > > approach you have here, of a deletable

[PATCH] Remove class cache_map and use ggc hash_maps instead (PR c++/70452)

2016-04-04 Thread Patrick Palka
On Mon, 4 Apr 2016, Jason Merrill wrote: > Hmm, I thought I remembered hitting the breakpoint in gt_cleare_cache and it > being non-null. But I guess we can get rid of the cache_map class and use the > approach you have here, of a deletable gc-allocated hash_map pointer; I'd > still use ->empty()