This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 5/9] Fix memory leak in tree-vect-slp.c
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: marxin <mliska at suse dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 19 May 2016 13:15:33 +0200
- Subject: Re: [PATCH 5/9] Fix memory leak in tree-vect-slp.c
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1463654693 dot git dot mliska at suse dot cz> <0291d0aa5611d8fdfd07ec5729afdef83459a4fc dot 1463654693 dot git dot mliska at suse dot cz>
On Thu, May 19, 2016 at 12:44 PM, marxin <mliska@suse.cz> wrote:
> Leak can be seen e.g. here:
> gcc pr68817.f90 -fno-diagnostics-show-caret -fdiagnostics-color=never -O -O3 -ffast-math
Ok for trunk and branches.
Richard.
> gcc/ChangeLog:
>
> 2016-05-18 Martin Liska <mliska@suse.cz>
>
> * tree-vect-slp.c (vect_attempt_slp_rearrange_stmts): Release
> bitmap.
> ---
> gcc/tree-vect-slp.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
> index d713848..66db7d5 100644
> --- a/gcc/tree-vect-slp.c
> +++ b/gcc/tree-vect-slp.c
> @@ -1308,7 +1308,10 @@ vect_attempt_slp_rearrange_stmts (slp_instance slp_instn)
> FOR_EACH_VEC_ELT (node->load_permutation, i, lidx)
> {
> if (lidx >= group_size)
> - return false;
> + {
> + sbitmap_free (load_index);
> + return false;
> + }
> if (bitmap_bit_p (load_index, lidx))
> {
> sbitmap_free (load_index);
> --
> 2.8.2
>
>