This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix vect_create_epilog_for_reduction memory leaks (PR middle-end/56461)
- From: Richard Biener <rguenther at suse dot de>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 5 Mar 2013 10:06:18 +0100 (CET)
- Subject: Re: [PATCH] Fix vect_create_epilog_for_reduction memory leaks (PR middle-end/56461)
- References: <20130304210333.GS12913@tucnak.redhat.com>
On Mon, 4 Mar 2013, Jakub Jelinek wrote:
> Hi!
>
> vect_create_epilog_for_reduction leaks memory both from the inner_phis
> vector not being released for double_reduc, and also for stmt_vec_info
> it creates (because those are added for stmts added into exit_bb, i.e.
> after loop, which destroy_loop_vec_info doesn't free). 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-stmts.c (free_stmt_vec_info_vec): Call
> free_stmt_vec_info on any left-over stmt_vec_info in the vector.
> * tree-vect-loop.c (vect_create_epilog_for_reduction): Release
> inner_phis vector.
>
> --- gcc/tree-vect-stmts.c.jj 2013-03-04 11:07:33.000000000 +0100
> +++ gcc/tree-vect-stmts.c 2013-03-04 12:14:16.111393716 +0100
> @@ -5969,6 +5969,11 @@ init_stmt_vec_info_vec (void)
> void
> free_stmt_vec_info_vec (void)
> {
> + unsigned int i;
> + vec_void_p info;
> + FOR_EACH_VEC_ELT (stmt_vec_info_vec, i, info)
> + if (info != NULL)
> + free_stmt_vec_info (STMT_VINFO_STMT ((stmt_vec_info) info));
> gcc_assert (stmt_vec_info_vec.exists ());
> stmt_vec_info_vec.release ();
> }
> --- gcc/tree-vect-loop.c.jj 2013-03-04 11:01:48.000000000 +0100
> +++ gcc/tree-vect-loop.c 2013-03-04 12:17:09.934351015 +0100
> @@ -4487,8 +4487,9 @@ vect_finalize_reduction:
> }
>
> scalar_results.release ();
> + inner_phis.release ();
> new_phis.release ();
> -}
> +}
>
>
> /* Function vectorizable_reduction.
>
> Jakub
>
>
--
Richard Biener <rguenther@suse.de>
SUSE / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix Imend