]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR debug/59992 (Compilation of insn-recog.c too slow due to var-tracking)
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 28 Feb 2014 12:57:06 +0000 (12:57 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 28 Feb 2014 12:57:06 +0000 (12:57 +0000)
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

gcc/ChangeLog
gcc/cselib.c

index 51c270614de9fe69d134b48814a18de6dc117787..0ea85dcecf64b8dee64ad7a00348d93e7df3b5dc 100644 (file)
@@ -1,3 +1,10 @@
+2014-02-28  Alexandre Oliva <aoliva@redhat.com>
+
+       PR debug/59992
+       * cselib.c (remove_useless_values): Skip to avoid quadratic
+       behavior if the condition moved from...
+       (cselib_process_insn): ... here holds.
+
 2014-02-28  Alexandre Oliva <aoliva@redhat.com>
 
        PR debug/57232
index 525e717c6338afd492ccd93897553d6392b0107b..dabd2d32f634493890e45a7349810f2901f121ab 100644 (file)
@@ -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