diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-27 16:03:22 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-27 16:03:22 +0000 |
commit | b0d535b8b41f804bb2651c279ce61f6b99ea781e (patch) | |
tree | 77a6d486ea57a6b544ceda3cd1825bfda772ecac /gcc/cselib.c | |
parent | 7824554a7ca06bad24bb4830612f45302f238744 (diff) | |
download | gcc-b0d535b8b41f804bb2651c279ce61f6b99ea781e.tar.gz |
PR rtl-optimization/28071
* cselib.c (cselib_process_insn): Don't remove useless values too
often for very large hashtables.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115777 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r-- | gcc/cselib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c index 0fc8aeef2cf..edfc328c0d8 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -1437,7 +1437,11 @@ cselib_process_insn (rtx insn) cselib_current_insn_in_libcall = false; cselib_current_insn = 0; - if (n_useless_values > MAX_USELESS_VALUES) + if (n_useless_values > MAX_USELESS_VALUES + /* remove_useless_values is linear in the hash table size. Avoid + quadratic behaviour for very large hashtables with very few + useless elements. */ + && (unsigned int)n_useless_values > cselib_hash_table->n_elements / 4) remove_useless_values (); } |