Memory leaks in compiler
Ira Rosen
IRAR@il.ibm.com
Tue Jan 29 17:39:00 GMT 2008
(I am resending this, since some of the addresses got corrupted. My
apologies.)
Hi,
gcc-owner@gcc.gnu.org wrote on 16/01/2008 15:20:00:
> > When a loop is vectorized, some statements are removed from the basic
> > blocks, but the vectorizer information attached to these BBs is never
> > freed.
>
> Sebastian, thanks for bringing this to our attention. I'll look into
this.
> I hope that removing stmts from a BB can be easily localized.
> -- Victor
>
The attached patch, mainly written by Victor, fixes memory leaks in the
vectorizer, that were found with the help of valgrind and by examining the
code.
Bootstrapped with vectorization enabled and tested on vectorizer testsuite
on ppc-linux. I still have to perform full regtesting.
Is it O.K. for 4.3? Or will it wait for 4.4?
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: memleaks.txt)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: memleaks.txt
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20080129/13d36cd8/attachment.txt>
More information about the Gcc
mailing list