Patchwork plug mem leak in gcse

login
register
mail settings
Submitter Steven Bosscher
Date March 28, 2011, 1:29 p.m.
Message ID <AANLkTi=j=a4RuXQW3wH8EEz=zwUYWY8NWD=gdZUJZNDZ@mail.gmail.com>
Download mbox | patch
Permalink /patch/88601/
State New
Headers show

Comments

Steven Bosscher - March 28, 2011, 1:29 p.m.
Hi,

The bitmap reg_set_bitmap is allocated in alloc_gcse_mem, but it is
never freed. The foul smell of a mem leak...

Plugged thus. Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk?

Ciao!
Steven


* gcse.c (free_gcse_mem): Free reg_set_bitmap.
Richard Guenther - March 28, 2011, 1:40 p.m.
On Mon, Mar 28, 2011 at 3:29 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Hi,
>
> The bitmap reg_set_bitmap is allocated in alloc_gcse_mem, but it is
> never freed. The foul smell of a mem leak...
>
> Plugged thus. Bootstrapped&tested on x86_64-unknown-linux-gnu. OK for trunk?

Ok.

Thanks,
Richard.

> Ciao!
> Steven
>
>
> * gcse.c (free_gcse_mem): Free reg_set_bitmap.
>
> Index: gcse.c
> ===================================================================
> --- gcse.c      (revision 171599)
> +++ gcse.c      (working copy)
> @@ -657,6 +657,8 @@
>  static void
>  free_gcse_mem (void)
>  {
> +  FREE_REG_SET (reg_set_bitmap);
> +
>   free_modify_mem_tables ();
>   BITMAP_FREE (modify_mem_list_set);
>   BITMAP_FREE (blocks_with_calls);
>

Patch

Index: gcse.c
===================================================================
--- gcse.c	(revision 171599)
+++ gcse.c	(working copy)
@@ -657,6 +657,8 @@ 
 static void
 free_gcse_mem (void)
 {
+  FREE_REG_SET (reg_set_bitmap);
+
   free_modify_mem_tables ();
   BITMAP_FREE (modify_mem_list_set);
   BITMAP_FREE (blocks_with_calls);