diff mbox

Fix vect_supported_load_permutation_p memory leak (PR middle-end/56461)

Message ID 20130304210705.GU12913@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek March 4, 2013, 9:07 p.m. UTC
Hi!

When returning true, load_index sbitmap is released, but not when returning
false.  Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk?

2013-03-04  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/56461
	* tree-vect-slp.c (vect_supported_load_permutation_p): Free
	load_index sbitmap even if some bit in it isn't set.


	Jakub

Comments

Richard Biener March 5, 2013, 9:07 a.m. UTC | #1
On Mon, 4 Mar 2013, Jakub Jelinek wrote:

> Hi!
> 
> When returning true, load_index sbitmap is released, but not when returning
> false.  Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?

Ok.

Thanks,
Richard.

> 2013-03-04  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR middle-end/56461
> 	* tree-vect-slp.c (vect_supported_load_permutation_p): Free
> 	load_index sbitmap even if some bit in it isn't set.
> 
> --- gcc/tree-vect-slp.c.jj	2013-02-28 22:19:57.000000000 +0100
> +++ gcc/tree-vect-slp.c	2013-03-04 15:01:48.441490311 +0100
> @@ -1429,7 +1429,10 @@ vect_supported_load_permutation_p (slp_i
>   
>    for (j = 0; j < group_size; j++)
>      if (!bitmap_bit_p (load_index, j))
> -      return false;
> +      {
> +	sbitmap_free (load_index);
> +	return false;
> +      }
>  
>    sbitmap_free (load_index);
>  
> 
> 	Jakub
> 
>
diff mbox

Patch

--- gcc/tree-vect-slp.c.jj	2013-02-28 22:19:57.000000000 +0100
+++ gcc/tree-vect-slp.c	2013-03-04 15:01:48.441490311 +0100
@@ -1429,7 +1429,10 @@  vect_supported_load_permutation_p (slp_i
  
   for (j = 0; j < group_size; j++)
     if (!bitmap_bit_p (load_index, j))
-      return false;
+      {
+	sbitmap_free (load_index);
+	return false;
+      }
 
   sbitmap_free (load_index);