]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/56461 (GCC is leaking lots of memory)
authorJakub Jelinek <jakub@redhat.com>
Tue, 5 Mar 2013 15:50:38 +0000 (16:50 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 5 Mar 2013 15:50:38 +0000 (16:50 +0100)
PR middle-end/56461
* lra.c (lra): Call lra_clear_live_ranges if live_p,
right before calling lra_create_live_ranges, also call it
when clearing live_p.  Only call lra_clear_live_ranges
at the end if live_p.

From-SVN: r196468

gcc/ChangeLog
gcc/lra.c

index 573f22431ea38522108fc3a66ce97e5581423b21..4734403f9f8219ec633c28c3b4eedc26e410fd2f 100644 (file)
@@ -1,5 +1,11 @@
 2013-03-05  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/56461
+       * lra.c (lra): Call lra_clear_live_ranges if live_p,
+       right before calling lra_create_live_ranges, also call it
+       when clearing live_p.  Only call lra_clear_live_ranges
+       at the end if live_p.
+
        PR middle-end/56461
        * sched-deps.c (delete_dep_node): Free DEP_REPLACE.
 
index 875c7afddabcc322510433d063cb3fb0b0fd69be..9df24b5ba9a885e9eade6d48ef9d4271f0e1d8e9 100644 (file)
--- a/gcc/lra.c
+++ b/gcc/lra.c
@@ -2291,6 +2291,8 @@ lra (FILE *f)
          /* Do inheritance only for regular algorithms.  */
          if (! lra_simple_p)
            lra_inheritance ();
+         if (live_p)
+           lra_clear_live_ranges ();
          /* We need live ranges for lra_assign -- so build them.  */
          lra_create_live_ranges (true);
          live_p = true;
@@ -2308,6 +2310,8 @@ lra (FILE *f)
                live_p = false;
              if (lra_undo_inheritance ())
                live_p = false;
+             if (! live_p)
+               lra_clear_live_ranges ();
            }
        }
       bitmap_clear (&lra_optional_reload_pseudos);
@@ -2334,7 +2338,8 @@ lra (FILE *f)
   lra_eliminate (true);
   lra_final_code_change ();
   lra_in_progress = 0;
-  lra_clear_live_ranges ();
+  if (live_p)
+    lra_clear_live_ranges ();
   lra_live_ranges_finish ();
   lra_constraints_finish ();
   finish_reg_info ();