This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch #PR 25933] memory leaks


This is a modified patch with all the changes suggested by Ian. I hope this is in right 
format now. Compiler has been bootstrapped ok on powerpc64-linux and the test results show 
no new regressions.

Thanks in advance for reviewing it.

Uttam


2006-01-23  Uttam Pawar  <uttamp@us.ibm.com>

        PR middle-end/25933
        * loop-unroll.c (unroll_loop_runtime_iterations): Fix for
        a memory leak.
        * tree-ssa-live.c (type_var_init): Fix for a memory leak.

diff -urpN trunk.orig/gcc/loop-unroll.c trunk/gcc/loop-unroll.c
--- trunk.orig/gcc/loop-unroll.c        2006-01-18 10:03:20.000000000 -0800
+++ trunk/gcc/loop-unroll.c     2006-01-24 10:00:16.000000000 -0800
@@ -1168,6 +1168,9 @@ unroll_loop_runtime_iterations (struct l
             ";; Unrolled loop %d times, counting # of iterations "
             "in runtime, %i insns\n",
             max_unroll, num_loop_insns (loop));
+
+  if (dom_bbs)
+    free (dom_bbs);
 }

 /* Decide whether to simply peel LOOP and how much.  */
diff -urpN trunk.orig/gcc/tree-ssa-live.c trunk/gcc/tree-ssa-live.c
--- trunk.orig/gcc/tree-ssa-live.c      2006-01-18 10:03:20.000000000 -0800
+++ trunk/gcc/tree-ssa-live.c   2006-01-24 10:01:53.000000000 -0800
@@ -1079,11 +1079,15 @@ type_var_init (var_map map)
   sbitmap seen;

   seen = sbitmap_alloc (num_partitions);
-  sbitmap_zero (seen);

   tv = tpa_init (map);
   if (!tv)
-    return NULL;
+    {
+      sbitmap_free (seen);
+      return NULL;
+    }
+
+  sbitmap_zero (seen);

   for (x = num_partitions - 1; x >= 0; x--)
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]