aboutsummaryrefslogtreecommitdiff
path: root/gcc/hash-table.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-06-07 14:13:13 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-06-07 12:13:13 +0000
commit510c9192493b6af5c4c70b14390fe340bca8ecaa (patch)
treec2e8bab0a5b755fef04328d8776654af5bc76f67 /gcc/hash-table.c
parent686a56a85d39750cd5c0c42f2ea747c8632e519e (diff)
downloadgcc-510c9192493b6af5c4c70b14390fe340bca8ecaa.zip
gcc-510c9192493b6af5c4c70b14390fe340bca8ecaa.tar.gz
gcc-510c9192493b6af5c4c70b14390fe340bca8ecaa.tar.bz2
Enable sanitization for hash tables.
2019-06-07 Martin Liska <mliska@suse.cz> * cselib.c (cselib_init): Disable hash table sanitization. * hash-set.h: Pass new default argument to m_table. * hash-table.c: Add global variable with hash table sanitization limit. * hash-table.h (Allocator>::hash_table): Add new argument to ctor. (hashtab_chk_error): New. * params.def (PARAM_HASH_TABLE_VERIFICATION_LIMIT): New. * toplev.c (process_options): Set hash_table_sanitize_eq_limit from the PARAM_HASH_TABLE_VERIFICATION_LIMIT value. From-SVN: r272038
Diffstat (limited to 'gcc/hash-table.c')
-rw-r--r--gcc/hash-table.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/hash-table.c b/gcc/hash-table.c
index 646a7a1..8e86fff 100644
--- a/gcc/hash-table.c
+++ b/gcc/hash-table.c
@@ -74,6 +74,9 @@ struct prime_ent const prime_tab[] = {
{ 0xfffffffb, 0x00000006, 0x00000008, 31 }
};
+/* Limit number of comparisons when calling hash_table<>::verify. */
+unsigned int hash_table_sanitize_eq_limit;
+
/* The following function returns an index into the above table of the
nearest prime number which is greater than N, and near a power of two. */