diff options
-rw-r--r-- | gcc/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/bb-reorder.c | 10 | ||||
-rw-r--r-- | gcc/collect2.c | 1 | ||||
-rw-r--r-- | gcc/matrix-reorg.c | 5 | ||||
-rw-r--r-- | gcc/omega.c | 4 | ||||
-rw-r--r-- | gcc/reload1.c | 1 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 8 |
7 files changed, 32 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ec3d87..4903b79 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +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> * config/sh/sh.h (DO_GLOBAL_CTORS_BODY): Add void to prototype. diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index dd6d30e..4be0d80 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -180,7 +180,7 @@ static void connect_traces (int, struct trace *); static bool copy_bb_p (basic_block, int); static int get_uncond_jump_length (void); 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 *); static void add_labels_and_missing_jumps (edge *, int); @@ -1219,7 +1219,7 @@ get_uncond_jump_length (void) cache locality). */ 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 *max_idx) { @@ -1256,10 +1256,10 @@ find_rarely_executed_basic_blocks_and_crossing_edges (edge *crossing_edges, if (i == *max_idx) { *max_idx *= 2; - crossing_edges = xrealloc (crossing_edges, + *crossing_edges = xrealloc (*crossing_edges, (*max_idx) * sizeof (edge)); } - crossing_edges[i++] = e; + (*crossing_edges)[i++] = e; } else e->flags &= ~EDGE_CROSSING; @@ -2168,7 +2168,7 @@ partition_hot_cold_basic_blocks (void) && cur_bb->next_bb->index >= NUM_FIXED_BLOCKS) 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, &max_edges); diff --git a/gcc/collect2.c b/gcc/collect2.c index 1ef174f..1ef3bbf 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -737,6 +737,7 @@ prefix_from_string (const char *p, struct path_prefix *pprefix) else endp++; } + free (nstore); } /* Main program. */ diff --git a/gcc/matrix-reorg.c b/gcc/matrix-reorg.c index 5b54fe0..0cff06f 100644 --- a/gcc/matrix-reorg.c +++ b/gcc/matrix-reorg.c @@ -1481,10 +1481,13 @@ check_allocation_function (void **slot, void *data ATTRIBUTE_UNUSED) block_stmt_iterator bsi; basic_block bb_level_0; struct matrix_info *mi = *slot; - sbitmap visited = sbitmap_alloc (num_ssa_names); + sbitmap visited; if (!mi->malloc_for_level) return 1; + + visited = sbitmap_alloc (num_ssa_names); + /* Do nothing if the current function is not the allocation function of MI. */ if (mi->allocation_function_decl != current_function_decl diff --git a/gcc/omega.c b/gcc/omega.c index 900ca85..ed6f536 100644 --- a/gcc/omega.c +++ b/gcc/omega.c @@ -2454,7 +2454,7 @@ coalesce (omega_pb pb) { int e, e2; int colors = 0; - bool *is_dead = XNEWVEC (bool, OMEGA_MAX_GEQS); + bool *is_dead; int found_something = 0; for (e = 0; e < pb->num_geqs; e++) @@ -2464,6 +2464,8 @@ coalesce (omega_pb pb) if (colors < 2) return; + is_dead = XNEWVEC (bool, OMEGA_MAX_GEQS); + for (e = 0; e < pb->num_geqs; e++) is_dead[e] = false; diff --git a/gcc/reload1.c b/gcc/reload1.c index fda1adc..12b847b 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -8639,6 +8639,7 @@ fixup_abnormal_edges (void) blocks = sbitmap_alloc (last_basic_block); sbitmap_ones (blocks); find_many_sub_basic_blocks (blocks); + sbitmap_free (blocks); } if (inserted) diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 193c549..a46ff80 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -671,7 +671,11 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *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 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, corresponds the order of data-refs in RESULT_CHAIN. */ next_stmt = first_stmt; 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) break; |