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


Ian,

> I should have mentioned this before, but the ChangeLog entry should
> say what you did, not why.
> 
> This is OK with this ChangeLog entry:
> 
> 	* loop-unroll.c (unroll_loop_runtime_iterations): Free
> 	dom_bbs.
> 	* tree-ssa-live.c (type_var_init): Allocate bitmap after
> 	call to tpa_init.
> 

I've made the appropriate changes as per your suggestion. 

> Go ahead and commit it.

I guess, I do not have commit access (never did that before).

Thanks again for the feedback.

Here is the latest patch.

=================================================================

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

        PR middle-end/25933
        * loop-unroll.c (unroll_loop_runtime_iterations): Free
        dom_bbs pointer.
        * tree-ssa-live.c (type_var_init): Allocate bitmap after
        call to tpa_init.

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-27 09:39:37.000000000 -0800
@@ -1078,13 +1078,13 @@ type_var_init (var_map map)
   tree t;
   sbitmap seen;

-  seen = sbitmap_alloc (num_partitions);
-  sbitmap_zero (seen);
-
   tv = tpa_init (map);
   if (!tv)
     return NULL;

+  seen = sbitmap_alloc (num_partitions);
+  sbitmap_zero (seen);
+
   for (x = num_partitions - 1; x >= 0; x--)
     {
       t = partition_to_var (map, x);



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