Commit 639d3040 by Dirk Mueller Committed by Dirk Mueller

omega.c (coalesce): Fix memory leak on early exit.

2007-07-15  Dirk Mueller  <dmueller@suse.de>

        * omega.c (coalesce): Fix memory leak on early exit.
        * matrix-reorg.c (check_allocation_function): Likewise.
        * tree-vect-transform.c (vect_get_new_vect_var): free result
        of concat().
        * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
        pass pointer to edge vector
        (partition_hot_cold_basic_blocks): Fix memory leak.
        * collect2.c (prefix_from_string): Free temporary storage.
        * reload1.c (fixup_abnormal_edges): Free sbitmap.

From-SVN: r126653
parent d40150cc
2007-07-14 Dirk Mueller <dmueller@suse.de>
* omega.c (coalesce): Fix memory leak on early exit.
* matrix-reorg.c (check_allocation_function): Likewise.
* tree-vect-transform.c (vect_get_new_vect_var): free result
of concat().
* bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
pass pointer to edge vector
(partition_hot_cold_basic_blocks): Fix memory leak.
* collect2.c (prefix_from_string): Free temporary storage.
* reload1.c (fixup_abnormal_edges): Free sbitmap.
2007-07-14 Kaz Kojima <kkojima@gcc.gnu.org> 2007-07-14 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.h (DO_GLOBAL_CTORS_BODY): Add void to prototype. * config/sh/sh.h (DO_GLOBAL_CTORS_BODY): Add void to prototype.
......
...@@ -180,7 +180,7 @@ static void connect_traces (int, struct trace *); ...@@ -180,7 +180,7 @@ static void connect_traces (int, struct trace *);
static bool copy_bb_p (basic_block, int); static bool copy_bb_p (basic_block, int);
static int get_uncond_jump_length (void); static int get_uncond_jump_length (void);
static bool push_to_next_round_p (basic_block, int, int, int, gcov_type); static bool push_to_next_round_p (basic_block, int, int, int, gcov_type);
static void find_rarely_executed_basic_blocks_and_crossing_edges (edge *, static void find_rarely_executed_basic_blocks_and_crossing_edges (edge **,
int *, int *,
int *); int *);
static void add_labels_and_missing_jumps (edge *, int); static void add_labels_and_missing_jumps (edge *, int);
...@@ -1219,7 +1219,7 @@ get_uncond_jump_length (void) ...@@ -1219,7 +1219,7 @@ get_uncond_jump_length (void)
cache locality). */ cache locality). */
static void static void
find_rarely_executed_basic_blocks_and_crossing_edges (edge *crossing_edges, find_rarely_executed_basic_blocks_and_crossing_edges (edge **crossing_edges,
int *n_crossing_edges, int *n_crossing_edges,
int *max_idx) int *max_idx)
{ {
...@@ -1256,10 +1256,10 @@ find_rarely_executed_basic_blocks_and_crossing_edges (edge *crossing_edges, ...@@ -1256,10 +1256,10 @@ find_rarely_executed_basic_blocks_and_crossing_edges (edge *crossing_edges,
if (i == *max_idx) if (i == *max_idx)
{ {
*max_idx *= 2; *max_idx *= 2;
crossing_edges = xrealloc (crossing_edges, *crossing_edges = xrealloc (*crossing_edges,
(*max_idx) * sizeof (edge)); (*max_idx) * sizeof (edge));
} }
crossing_edges[i++] = e; (*crossing_edges)[i++] = e;
} }
else else
e->flags &= ~EDGE_CROSSING; e->flags &= ~EDGE_CROSSING;
...@@ -2168,7 +2168,7 @@ partition_hot_cold_basic_blocks (void) ...@@ -2168,7 +2168,7 @@ partition_hot_cold_basic_blocks (void)
&& cur_bb->next_bb->index >= NUM_FIXED_BLOCKS) && cur_bb->next_bb->index >= NUM_FIXED_BLOCKS)
cur_bb->aux = cur_bb->next_bb; cur_bb->aux = cur_bb->next_bb;
find_rarely_executed_basic_blocks_and_crossing_edges (crossing_edges, find_rarely_executed_basic_blocks_and_crossing_edges (&crossing_edges,
&n_crossing_edges, &n_crossing_edges,
&max_edges); &max_edges);
......
...@@ -737,6 +737,7 @@ prefix_from_string (const char *p, struct path_prefix *pprefix) ...@@ -737,6 +737,7 @@ prefix_from_string (const char *p, struct path_prefix *pprefix)
else else
endp++; endp++;
} }
free (nstore);
} }
/* Main program. */ /* Main program. */
......
...@@ -1481,10 +1481,13 @@ check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED) ...@@ -1481,10 +1481,13 @@ check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED)
block_stmt_iterator bsi; block_stmt_iterator bsi;
basic_block bb_level_0; basic_block bb_level_0;
struct matrix_info *mi = *slot; struct matrix_info *mi = *slot;
sbitmap visited = sbitmap_alloc (num_ssa_names); sbitmap visited;
if (!mi->malloc_for_level) if (!mi->malloc_for_level)
return 1; return 1;
visited = sbitmap_alloc (num_ssa_names);
/* Do nothing if the current function is not the allocation /* Do nothing if the current function is not the allocation
function of MI. */ function of MI. */
if (mi->allocation_function_decl != current_function_decl if (mi->allocation_function_decl != current_function_decl
......
...@@ -2454,7 +2454,7 @@ coalesce (omega_pb pb) ...@@ -2454,7 +2454,7 @@ coalesce (omega_pb pb)
{ {
int e, e2; int e, e2;
int colors = 0; int colors = 0;
bool *is_dead = XNEWVEC (bool, OMEGA_MAX_GEQS); bool *is_dead;
int found_something = 0; int found_something = 0;
for (e = 0; e < pb->num_geqs; e++) for (e = 0; e < pb->num_geqs; e++)
...@@ -2464,6 +2464,8 @@ coalesce (omega_pb pb) ...@@ -2464,6 +2464,8 @@ coalesce (omega_pb pb)
if (colors < 2) if (colors < 2)
return; return;
is_dead = XNEWVEC (bool, OMEGA_MAX_GEQS);
for (e = 0; e < pb->num_geqs; e++) for (e = 0; e < pb->num_geqs; e++)
is_dead[e] = false; is_dead[e] = false;
......
...@@ -8639,6 +8639,7 @@ fixup_abnormal_edges (void) ...@@ -8639,6 +8639,7 @@ fixup_abnormal_edges (void)
blocks = sbitmap_alloc (last_basic_block); blocks = sbitmap_alloc (last_basic_block);
sbitmap_ones (blocks); sbitmap_ones (blocks);
find_many_sub_basic_blocks (blocks); find_many_sub_basic_blocks (blocks);
sbitmap_free (blocks);
} }
if (inserted) if (inserted)
......
...@@ -671,7 +671,11 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name) ...@@ -671,7 +671,11 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name)
} }
if (name) if (name)
new_vect_var = create_tmp_var (type, concat (prefix, name, NULL)); {
char* tmp = concat (prefix, name, NULL);
new_vect_var = create_tmp_var (type, tmp);
free (tmp);
}
else else
new_vect_var = create_tmp_var (type, prefix); new_vect_var = create_tmp_var (type, prefix);
...@@ -4443,7 +4447,7 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size, ...@@ -4443,7 +4447,7 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
corresponds the order of data-refs in RESULT_CHAIN. */ corresponds the order of data-refs in RESULT_CHAIN. */
next_stmt = first_stmt; next_stmt = first_stmt;
gap_count = 1; gap_count = 1;
for (i = 0; VEC_iterate(tree, result_chain, i, tmp_data_ref); i++) for (i = 0; VEC_iterate (tree, result_chain, i, tmp_data_ref); i++)
{ {
if (!next_stmt) if (!next_stmt)
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment