* gcc.c (record_temp_file): Release name string.
* ifcvt.c (noce_convert_multiple_sets): Use auto_vec instead
of vec.
* lra-lives.c (free_live_range_list): Utilize
lra_live_range_pool for allocation and deallocation.
(create_live_range): Likewise.
(copy_live_range): Likewise.
(lra_merge_live_ranges): Likewise.
(remove_some_program_points_and_update_live_ranges): Likewise.
(lra_create_live_ranges_1): Release point_freq_vec that can
be not freed from previous iteration of the function.
* tree-eh.c (lower_try_finally_switch): Use auto_vec instead of
vec.
* tree-sra.c (sra_deinitialize): Release all vectors in
base_access_vec.
* tree-ssa-dom.c (free_dom_edge_info): Make the function extern.
* tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges):
Release edge_info for a removed edge.
(thread_through_all_blocks): Free region vector.
* tree-ssa.h (free_dom_edge_info): Declare function extern.
From-SVN: r230027
+2015-11-09 Martin Liska <mliska@suse.cz>
+
+ * gcc.c (record_temp_file): Release name string.
+ * ifcvt.c (noce_convert_multiple_sets): Use auto_vec instead
+ of vec.
+ * lra-lives.c (free_live_range_list): Utilize
+ lra_live_range_pool for allocation and deallocation.
+ (create_live_range): Likewise.
+ (copy_live_range): Likewise.
+ (lra_merge_live_ranges): Likewise.
+ (remove_some_program_points_and_update_live_ranges): Likewise.
+ (lra_create_live_ranges_1): Release point_freq_vec that can
+ be not freed from previous iteration of the function.
+ * tree-eh.c (lower_try_finally_switch): Use auto_vec instead of
+ vec.
+ * tree-sra.c (sra_deinitialize): Release all vectors in
+ base_access_vec.
+ * tree-ssa-dom.c (free_dom_edge_info): Make the function extern.
+ * tree-ssa-threadupdate.c (remove_ctrl_stmt_and_useless_edges):
+ Release edge_info for a removed edge.
+ (thread_through_all_blocks): Free region vector.
+ * tree-ssa.h (free_dom_edge_info): Declare function extern.
+
2015-11-09 Ilya Enkovich <enkovich.gnu@gmail.com>
* optabs.c (expand_vec_cond_expr): Always get sign from type.
struct temp_file *temp;
for (temp = always_delete_queue; temp; temp = temp->next)
if (! filename_cmp (name, temp->name))
- goto already1;
+ {
+ free (name);
+ goto already1;
+ }
temp = XNEW (struct temp_file);
temp->next = always_delete_queue;
rtx_code cond_code = GET_CODE (cond);
/* The true targets for a conditional move. */
- vec<rtx> targets = vNULL;
+ auto_vec<rtx> targets;
/* The temporaries introduced to allow us to not consider register
overlap. */
- vec<rtx> temporaries = vNULL;
+ auto_vec<rtx> temporaries;
/* The insns we've emitted. */
- vec<rtx_insn *> unmodified_insns = vNULL;
+ auto_vec<rtx_insn *> unmodified_insns;
int count = 0;
FOR_BB_INSNS (then_bb, insn)
while (lr != NULL)
{
next = lr->next;
- delete lr;
+ lra_live_range_pool.remove (lr);
lr = next;
}
}
static lra_live_range_t
create_live_range (int regno, int start, int finish, lra_live_range_t next)
{
- lra_live_range_t p = new lra_live_range;
+ lra_live_range_t p = lra_live_range_pool.allocate ();
p->regno = regno;
p->start = start;
p->finish = finish;
static lra_live_range_t
copy_live_range (lra_live_range_t r)
{
- return new lra_live_range (*r);
+ return new (lra_live_range_pool) lra_live_range (*r);
}
/* Copy live range list given by its head R and return the result. */
r1->start = r2->start;
lra_live_range_t temp = r2;
r2 = r2->next;
- delete temp;
+ lra_live_range_pool.remove (temp);
}
else
{
}
prev_r->start = r->start;
prev_r->next = next_r;
- delete r;
+ lra_live_range_pool.remove (r);
}
}
}
dead_set = sparseset_alloc (max_regno);
unused_set = sparseset_alloc (max_regno);
curr_point = 0;
- point_freq_vec.create (get_max_uid () * 2);
+ unsigned new_length = get_max_uid () * 2;
+ if (point_freq_vec.length () < new_length)
+ point_freq_vec.safe_grow (new_length);
lra_point_freq = point_freq_vec.address ();
int *post_order_rev_cfg = XNEWVEC (int, last_basic_block_for_fn (cfun));
int n_blocks_inverted = inverted_post_order_compute (post_order_rev_cfg);
int return_index, eh_index, fallthru_index;
int nlabels, ndests, j, last_case_index;
tree last_case;
- vec<tree> case_label_vec;
+ auto_vec<tree> case_label_vec;
gimple_seq switch_body = NULL;
gimple *x;
geh_else *eh_else;
assign_link_pool.release ();
obstack_free (&name_obstack, NULL);
+ /* TODO: hash_map does not support traits that can release
+ value type of the hash_map. */
+ for (hash_map<tree, auto_vec<access_p> >::iterator it =
+ base_access_vec->begin (); it != base_access_vec->end (); ++it)
+ (*it).second.release ();
+
delete base_access_vec;
}
/* Free the edge_info data attached to E, if it exists. */
-static void
-free_edge_info (edge e)
+void
+free_dom_edge_info (edge e)
{
struct edge_info *edge_info = (struct edge_info *)e->aux;
struct edge_info *edge_info;
/* Free the old one, if it exists. */
- free_edge_info (e);
+ free_dom_edge_info (e);
edge_info = XCNEW (struct edge_info);
{
FOR_EACH_EDGE (e, ei, bb->preds)
{
- free_edge_info (e);
+ free_dom_edge_info (e);
e->aux = NULL;
}
}
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
{
if (e->dest != dest_bb)
- remove_edge (e);
+ {
+ free_dom_edge_info (e);
+ remove_edge (e);
+ }
else
ei_next (&ei);
}
delete_jump_thread_path (path);
paths.unordered_remove (i);
+ free (region);
}
/* Remove from PATHS all the jump-threads starting with an edge already
extern void remove_jump_threads_including (edge);
extern void delete_jump_thread_path (vec <class jump_thread_edge *> *);
extern void remove_ctrl_stmt_and_useless_edges (basic_block, basic_block);
+extern void free_dom_edge_info (edge);
#endif