This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix memory leak in vectorizer
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Victor Kaplansky" <VICTORK at il dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, dorit at il dot ibm dot com, sebpop at gmail dot com, irar at il dot ibm dot com
- Date: Wed, 5 Mar 2008 10:57:25 +0100
- Subject: Re: [PATCH] Fix memory leak in vectorizer
- References: <OF47899B78.2CB9D1EC-ONC2257403.0030F346-C2257403.0032212B@il.ibm.com>
On Wed, Mar 5, 2008 at 10:07 AM, Victor Kaplansky <VICTORK@il.ibm.com> wrote:
>
> The attached patch, written together with Ira Rosen, fixes memory leaks in
> the
> vectorizer, that were found with the help of valgrind and by examining the
> code.
>
> Bootstrapped and regtested with vectorization enabled and full testsuite
> on x86_64.
>
> Is it O.K. for 4.4?
Yes, thanks.
Richard.
> Thanks,
> Victor and Ira
>
> ChangeLog:
>
> * tree-vectorizer.c (free_stmt_vec_info): New function.
> (destroy_loop_vec_info): Move code to free_stmt_vec_info().
> Call free_stmt_vec_info(). Free LOOP_VINFO_STRIDED_STORES..
> * tree-vectorizer.h (free_stmt_vec_info): Declare.
> * tree-vect-transform.c (vectorizable_conversion): Free
> vec_oprnds0 if it was allocated.
> (vect_permute_store_chain): Remove unused VECs.
> (vectorizable_store): Free VECs that are allocated in the..
> function.
> (vect_transform_strided_load, vectorizable_load): Likewise.
> (vect_remove_stores): Simplify the code.
> (vect_transform_loop): Move code to vect_remove_stores().
> Call vect_remove_stores() and free_stmt_vec_info().
>
> (See attached file: memleaks2.txt)