From ff7b3aa51f8edd24fdc599d9f95a5cbf61aeb76e Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Wed, 12 Jun 2019 15:07:07 +0200 Subject: [PATCH] Disable hash-table sanitization for mem stats maps. 2019-06-12 Martin Liska * ggc-common.c (ggc_prune_overhead_list): Do not sanitize the created map. * hash-map.h: Add sanitize_eq_and_hash into ::hash_map. * mem-stats.h (mem_alloc_description::mem_alloc_description): Do not sanitize created maps. From-SVN: r272183 --- gcc/ChangeLog | 8 ++++++++ gcc/ggc-common.c | 2 +- gcc/hash-map.h | 9 ++++++--- gcc/mem-stats.h | 6 +++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d58835d08a5..214ded49f1a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-06-12 Martin Liska + + * ggc-common.c (ggc_prune_overhead_list): Do not sanitize + the created map. + * hash-map.h: Add sanitize_eq_and_hash into ::hash_map. + * mem-stats.h (mem_alloc_description::mem_alloc_description): + Do not sanitize created maps. + 2019-06-12 Aldy Hernandez * gimple-ssa-evrp.c (evrp_dom_walker::before_dom_children): Use diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 2acdb6dc60c..6fb5a3d5ceb 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -1014,5 +1014,5 @@ ggc_prune_overhead_list (void) (*it).second.first->m_collected += (*it).second.second; delete ggc_mem_desc.m_reverse_object_map; - ggc_mem_desc.m_reverse_object_map = new map_t (13, false, false); + ggc_mem_desc.m_reverse_object_map = new map_t (13, false, false, false); } diff --git a/gcc/hash-map.h b/gcc/hash-map.h index a8eb42d5a03..588dfda04fa 100644 --- a/gcc/hash-map.h +++ b/gcc/hash-map.h @@ -118,16 +118,19 @@ class GTY((user)) hash_map public: explicit hash_map (size_t n = 13, bool ggc = false, + bool sanitize_eq_and_hash = true, bool gather_mem_stats = GATHER_STATISTICS CXX_MEM_STAT_INFO) - : m_table (n, ggc, true, gather_mem_stats, HASH_MAP_ORIGIN PASS_MEM_STAT) + : m_table (n, ggc, sanitize_eq_and_hash, gather_mem_stats, + HASH_MAP_ORIGIN PASS_MEM_STAT) { } explicit hash_map (const hash_map &h, bool ggc = false, + bool sanitize_eq_and_hash = true, bool gather_mem_stats = GATHER_STATISTICS CXX_MEM_STAT_INFO) - : m_table (h.m_table, ggc, true, gather_mem_stats, + : m_table (h.m_table, ggc, sanitize_eq_and_hash, gather_mem_stats, HASH_MAP_ORIGIN PASS_MEM_STAT) {} /* Create a hash_map in ggc memory. */ @@ -136,7 +139,7 @@ public: CXX_MEM_STAT_INFO) { hash_map *map = ggc_alloc (); - new (map) hash_map (size, true, gather_mem_stats PASS_MEM_STAT); + new (map) hash_map (size, true, true, gather_mem_stats PASS_MEM_STAT); return map; } diff --git a/gcc/mem-stats.h b/gcc/mem-stats.h index 63ce8712e2b..77960595753 100644 --- a/gcc/mem-stats.h +++ b/gcc/mem-stats.h @@ -559,9 +559,9 @@ template inline mem_alloc_description::mem_alloc_description () { - m_map = new mem_map_t (13, false, false); - m_reverse_map = new reverse_mem_map_t (13, false, false); - m_reverse_object_map = new reverse_object_map_t (13, false, false); + m_map = new mem_map_t (13, false, false, false); + m_reverse_map = new reverse_mem_map_t (13, false, false, false); + m_reverse_object_map = new reverse_object_map_t (13, false, false, false); } /* Default destructor. */ -- 2.30.2