This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix vect_supported_load_permutation_p memory leak (PR middle-end/56461)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 4 Mar 2013 22:07:05 +0100
- Subject: [PATCH] Fix vect_supported_load_permutation_p memory leak (PR middle-end/56461)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
--- 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