PR debug/59992
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Feb 2014 12:57:06 +0000 (12:57 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Feb 2014 12:57:06 +0000 (12:57 +0000)
* cselib.c (remove_useless_values): Skip to avoid quadratic
behavior if the condition moved from...
(cselib_process_insn): ... here holds.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208220 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cselib.c

index 51c2706..0ea85dc 100644 (file)
@@ -1,5 +1,12 @@
 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
        * var-tracking.c (vt_initialize): Apply the same condition to
        preserve the CFA base value.
index 525e717..dabd2d3 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