On Mon, Jan 13, 2020 at 11:51:53PM -0500, David Malcolm wrote: > > * cfg.s correctly has a call to memset (even with no optimization) > > for > > hash_table<bb_copy_hasher>::empty_slow
I have intestigated unpatched cc1plus and in the (usually inlined) alloc_entries I see in all the places the xcalloc or ggc_internal_cleared_alloc followed by either a loop storing some zeros or a memset, which is something I'd hope the patch also improves. As for graphite.c, sure, empty_zero_p = false is a fallback value, the question was not directly related to this patch, but rather wondering how it can work at all. > Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu (in > conjuction with the analyzer patch kit, which it fixes) > > OK for master? Yes to both patches, thanks. > gcc/cp/ChangeLog: Jakub Jelinek <ja...@redhat.com> > * cp-gimplify.c (source_location_table_entry_hash::empty_zero_p): > New static constant. > * cp-tree.h (named_decl_hash::empty_zero_p): Likewise. > (struct named_label_hash::empty_zero_p): Likewise. > * decl2.c (mangled_decl_hash::empty_zero_p): Likewise. > > gcc/ChangeLog: Jakub Jelinek <ja...@redhat.com>, > David Malcolm <dmalc...@redhat.com> > * attribs.c (excl_hash_traits::empty_zero_p): New static constant. > * gcov.c (function_start_pair_hash::empty_zero_p): Likewise. > * graphite.c (struct sese_scev_hash::empty_zero_p): Likewise. > * hash-map-tests.c (selftest::test_nonzero_empty_key): New selftest. > (selftest::hash_map_tests_c_tests): Call it. > * hash-map-traits.h (simple_hashmap_traits::empty_zero_p): > New static constant, using the value of = H::empty_zero_p. > (unbounded_hashmap_traits::empty_zero_p): Likewise, using the value > from default_hash_traits <Value>. > * hash-map.h (hash_map::empty_zero_p): Likewise, using the value > from Traits. > * hash-set-tests.c (value_hash_traits::empty_zero_p): Likewise. > * hash-table.h (hash_table::alloc_entries): Guard the loop of > calls to mark_empty with !Descriptor::empty_zero_p. > (hash_table::empty_slow): Conditionalize the memset call with a > check that Descriptor::empty_zero_p; otherwise, loop through the > entries calling mark_empty on them. > * hash-traits.h (int_hash::empty_zero_p): New static constant. > (pointer_hash::empty_zero_p): Likewise. > (pair_hash::empty_zero_p): Likewise. > * ipa-devirt.c (default_hash_traits <type_pair>::empty_zero_p): > Likewise. > * ipa-prop.c (ipa_bit_ggc_hash_traits::empty_zero_p): Likewise. > (ipa_vr_ggc_hash_traits::empty_zero_p): Likewise. > * profile.c (location_triplet_hash::empty_zero_p): Likewise. > * sanopt.c (sanopt_tree_triplet_hash::empty_zero_p): Likewise. > (sanopt_tree_couple_hash::empty_zero_p): Likewise. > * tree-hasher.h (int_tree_hasher::empty_zero_p): Likewise. > * tree-ssa-sccvn.c (vn_ssa_aux_hasher::empty_zero_p): Likewise. > * tree-vect-slp.c (bst_traits::empty_zero_p): Likewise. > * tree-vectorizer.h > (default_hash_traits<scalar_cond_masked_key>::empty_zero_p): > Likewise. Jakub