diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-12-23 16:25:52 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-12-23 16:25:52 +0000 |
commit | 01be8516aa6411606f2629cdc19c6acf62511ca6 (patch) | |
tree | 560661198b65a199d12abbb757c1a4560e199292 /gcc/tree-vect-loop.c | |
parent | f5333fe82b2a99b70066a31462e0137914a3c236 (diff) | |
download | gcc-01be8516aa6411606f2629cdc19c6acf62511ca6.zip gcc-01be8516aa6411606f2629cdc19c6acf62511ca6.tar.gz gcc-01be8516aa6411606f2629cdc19c6acf62511ca6.tar.bz2 |
Fix PR47002: memory leaks.
2010-12-23 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/47002
* tree-data-ref.c (compute_data_dependences_for_loop): Pass in a
pointer to the loop_nest.
(analyze_all_data_dependences): Initialize and free the loop_nest.
(free_dependence_relations): Do not free loop_nest.
(build_rdg): Pass in the loop_nest, datarefs, and dependence_relations.
(free_rdg): Also free the data on edges.
* tree-data-ref.h (build_rdg): Update declaration.
(compute_data_dependences_for_loop): Same.
* tree-if-conv.c (if_convertible_loop_p_1): Pass in the loop_nest.
(if_convertible_loop_p): Allocate and free loop_nest.
* tree-loop-distribution.c (rdg_flag_loop_exits): Free conds.
(free_rdg_components): VEC_free components.
(distribute_loop): Update call to build_rdg. Allocate and free
loop_nest, datarefs, and dependence_relations.
* tree-loop-linear.c (linear_transform_loops): Allocate and free
loop_nest.
* tree-parloops.c (loop_parallel_p): Same.
* tree-predcom.c (tree_predictive_commoning_loop): Same.
* tree-vect-data-refs.c (vect_analyze_data_refs): Pass to
compute_data_dependences_for_loop a pointer to LOOP_VINFO_LOOP_NEST.
* tree-vect-loop.c (new_loop_vec_info): Initialize LOOP_VINFO_LOOP_NEST.
(destroy_loop_vec_info): Free LOOP_VINFO_MAY_ALIAS_DDRS and
LOOP_VINFO_LOOP_NEST.
* tree-vect-slp.c (destroy_bb_vec_info): Call free_data_refs and
free_dependence_relations.
* tree-vectorizer.h (struct _loop_vec_info): Add a field loop_nest.
(LOOP_VINFO_LOOP_NEST): New.
From-SVN: r168210
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 2644c9e..1dc4ec0 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -745,6 +745,7 @@ new_loop_vec_info (struct loop *loop) LOOP_VINFO_VECTORIZABLE_P (res) = 0; LOOP_PEELING_FOR_ALIGNMENT (res) = 0; LOOP_VINFO_VECT_FACTOR (res) = 0; + LOOP_VINFO_LOOP_NEST (res) = VEC_alloc (loop_p, heap, 3); LOOP_VINFO_DATAREFS (res) = VEC_alloc (data_reference_p, heap, 10); LOOP_VINFO_DDRS (res) = VEC_alloc (ddr_p, heap, 10 * 10); LOOP_VINFO_UNALIGNED_DR (res) = NULL; @@ -793,7 +794,9 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts) free (LOOP_VINFO_BBS (loop_vinfo)); free_data_refs (LOOP_VINFO_DATAREFS (loop_vinfo)); free_dependence_relations (LOOP_VINFO_DDRS (loop_vinfo)); + VEC_free (loop_p, heap, LOOP_VINFO_LOOP_NEST (loop_vinfo)); VEC_free (gimple, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)); + VEC_free (ddr_p, heap, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo)); free (loop_vinfo); loop->aux = NULL; @@ -839,6 +842,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts) free (LOOP_VINFO_BBS (loop_vinfo)); free_data_refs (LOOP_VINFO_DATAREFS (loop_vinfo)); free_dependence_relations (LOOP_VINFO_DDRS (loop_vinfo)); + VEC_free (loop_p, heap, LOOP_VINFO_LOOP_NEST (loop_vinfo)); VEC_free (gimple, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)); VEC_free (ddr_p, heap, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo)); slp_instances = LOOP_VINFO_SLP_INSTANCES (loop_vinfo); |