aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2014-02-28 12:57:06 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2014-02-28 12:57:06 +0000
commit22414f3ffcc916cf5fdaa5d3b0d180c197b6d848 (patch)
tree7d53a818d98bcca10434e439b2d2301235657e96 /gcc/cselib.c
parent2e08491710f04b854ed9b7c8d0b520c2c6eac115 (diff)
downloadgcc-22414f3ffcc916cf5fdaa5d3b0d180c197b6d848.zip
gcc-22414f3ffcc916cf5fdaa5d3b0d180c197b6d848.tar.gz
gcc-22414f3ffcc916cf5fdaa5d3b0d180c197b6d848.tar.bz2
re PR debug/59992 (Compilation of insn-recog.c too slow due to var-tracking)
PR debug/59992 * cselib.c (remove_useless_values): Skip to avoid quadratic behavior if the condition moved from... (cselib_process_insn): ... here holds. From-SVN: r208220
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 525e717..dabd2d32 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -662,6 +662,14 @@ remove_useless_values (void)
{
cselib_val **p, *v;
+ if (n_useless_values <= MAX_USELESS_VALUES
+ /* remove_useless_values is linear in the hash table size. Avoid
+ quadratic behavior for very large hashtables with very few
+ useless elements. */
+ || ((unsigned int)n_useless_values
+ <= (cselib_hash_table.elements () - n_debug_values) / 4))
+ return;
+
/* First pass: eliminate locations that reference the value. That in
turn can make more values useless. */
do
@@ -2693,13 +2701,7 @@ cselib_process_insn (rtx insn)
cselib_current_insn = NULL_RTX;
- if (n_useless_values > MAX_USELESS_VALUES
- /* remove_useless_values is linear in the hash table size. Avoid
- quadratic behavior for very large hashtables with very few
- useless elements. */
- && ((unsigned int)n_useless_values
- > (cselib_hash_table.elements () - n_debug_values) / 4))
- remove_useless_values ();
+ remove_useless_values ();
}
/* Initialize cselib for one pass. The caller must also call