This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix memory leak in vectorizer

The attached patch, written together with Ira Rosen, fixes memory leaks in
vectorizer, that were found with the help of valgrind and by examining the

Bootstrapped and regtested with vectorization enabled and full testsuite
on x86_64.

Is it O.K. for 4.4?

Victor and Ira


      * 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..
      (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)

Attachment: memleaks2.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]