[patch #PR 26145] memory leak in loop unswitching

Uttam Pawar uttamp@us.ibm.com
Tue Feb 7 23:47:00 GMT 2006


Hi,

This patch fixes the reported memory leak. I hope this is in right format. Compiler has been bootstrapped ok on 
powerpc64-linux and the test results show no new regressions.

Thanks.

Uttam


2006-02-06  Uttam Pawar  <uttamp@us.ibm.com>

        PR tree-optimization/26145
        * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop):
        Free bbs pointer.

diff -urpN trunk.orig/gcc/tree-ssa-loop-unswitch.c trunk/gcc/tree-ssa-loop-unswitch.c
--- trunk.orig/gcc/tree-ssa-loop-unswitch.c     2006-02-06 17:19:43.000000000 -0800
+++ trunk/gcc/tree-ssa-loop-unswitch.c  2006-02-06 17:35:13.000000000 -0800
@@ -255,6 +255,7 @@ tree_unswitch_single_loop (struct loops
   if (!nloop)
     {
       free_original_copy_tables ();
+      free (bbs);
       return changed;
     }

@@ -265,6 +266,7 @@ tree_unswitch_single_loop (struct loops
   /* Invoke itself on modified loops.  */
   tree_unswitch_single_loop (loops, nloop, num + 1);
   tree_unswitch_single_loop (loops, loop, num + 1);
+  free (bbs);
   return true;
 }



More information about the Gcc-patches mailing list