Patchwork fix memory leak in trans-mem

login
register
mail settings
Submitter Aldy Hernandez
Date Nov. 19, 2012, 6:54 p.m.
Message ID <50AA8068.6050902@redhat.com>
Download mbox | patch
Permalink /patch/200134/
State New
Headers show

Comments

Aldy Hernandez - Nov. 19, 2012, 6:54 p.m.
This looks like a memory leak.

OK for trunk?
commit ca98b795aa229e3c277d6f0475bd30c16a5a9a8c
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Mon Nov 19 12:53:03 2012 -0600

           * trans-mem.c (execute_tm_mark): Release bb_regions.
Richard Henderson - Nov. 19, 2012, 10:11 p.m.
On 11/19/2012 10:54 AM, Aldy Hernandez wrote:
>            * trans-mem.c (execute_tm_mark): Release bb_regions.

Ok.


r~

Patch

diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index 15c02bd..79be8b9 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -2840,6 +2840,8 @@  execute_tm_mark (void)
     if (r != NULL)
       expand_block_tm (r, BASIC_BLOCK (i));
 
+  bb_regions.release ();
+
   // Propagate flags from inner transactions outwards.
   propagate_tm_flags_out (all_tm_regions);