This fixes various vec<> memory leaks as discovered compiling 521.wrf_r.
2021-02-02 Richard Biener <rguenther@suse.de>
* gimple-loop-interchange.cc (prepare_data_references):
Release vectors.
* gimple-loop-jam.c (tree_loop_unroll_and_jam): Likewise.
* tree-ssa-loop-im.c (hoist_memory_references): Likewise.
* tree-vect-stmts.c (vectorizable_condition): Do not
allocate vectors.
(vectorizable_comparison): Likewise.
delete bb_refs;
}
else if (bb_refs->is_empty ())
- delete bb_refs;
+ {
+ bb_refs->release ();
+ delete bb_refs;
+ }
else
bb->aux = bb_refs;
}
bb_refs = (vec<data_reference_p> *) bb->aux;
if (loop_nest && flow_bb_inside_loop_p (loop_nest, bb))
- datarefs->safe_splice (*bb_refs);
+ {
+ datarefs->safe_splice (*bb_refs);
+ bb_refs->release ();
+ }
else
free_data_refs (*bb_refs);
if (!unroll_jam_possible_p (outer, loop))
continue;
- vec<data_reference_p> datarefs;
- vec<ddr_p> dependences;
+ vec<data_reference_p> datarefs = vNULL;
+ vec<ddr_p> dependences = vNULL;
unsigned unroll_factor, profit_unroll, removed;
class tree_niter_desc desc;
bool unroll = false;
auto_vec<loop_p, 3> loop_nest;
- dependences.create (10);
- datarefs.create (10);
if (!compute_data_dependences_for_loop (outer, true, &loop_nest,
&datarefs, &dependences))
{
if (res != 1)
{
bitmap_copy (refs_not_supported, mem_refs);
+ seq.release ();
break;
}
sms.safe_push (std::make_pair (e, seq));
/* Transform. */
- if (!slp_node)
- {
- vec_oprnds0.create (1);
- vec_oprnds1.create (1);
- vec_oprnds2.create (1);
- vec_oprnds3.create (1);
- }
-
/* Handle def. */
scalar_dest = gimple_assign_lhs (stmt);
if (reduction_type != EXTRACT_LAST_REDUCTION)
}
/* Transform. */
- if (!slp_node)
- {
- vec_oprnds0.create (1);
- vec_oprnds1.create (1);
- }
/* Handle def. */
lhs = gimple_assign_lhs (stmt);