diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2010-01-07 18:32:51 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2010-01-07 18:32:51 +0000 |
commit | 556afcdc1107b79c8f037cc1f9dc4f5a220ff8e4 (patch) | |
tree | 6e8b7af7a18c1c655884e15f7890e21a3bb5fd4c /gcc/graphite-clast-to-gimple.c | |
parent | e68c3c6cc5c3c64ed5aeeec90ac7db195ce7a2e2 (diff) | |
download | gcc-556afcdc1107b79c8f037cc1f9dc4f5a220ff8e4.zip gcc-556afcdc1107b79c8f037cc1f9dc4f5a220ff8e4.tar.gz gcc-556afcdc1107b79c8f037cc1f9dc4f5a220ff8e4.tar.bz2 |
Fix memory leaks.
2010-01-06 Sebastian Pop <sebastian.pop@amd.com>
* graphite-clast-to-gimple.c (save_clast_name_index): Free slot
before allocating a new one.
(copy_renames): Check that slot is not NULL.
(mark_bb_with_pbb): Same.
(compute_cloog_iv_types_1): Same.
* graphite-interchange.c (lst_perfect_nestify): Free the before,
nest, and after LSTs.
(lst_try_interchange_loops): Same.
From-SVN: r155702
Diffstat (limited to 'gcc/graphite-clast-to-gimple.c')
-rw-r--r-- | gcc/graphite-clast-to-gimple.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c index 93138b6..4109461 100644 --- a/gcc/graphite-clast-to-gimple.c +++ b/gcc/graphite-clast-to-gimple.c @@ -117,7 +117,12 @@ save_clast_name_index (htab_t index_table, const char *name, int index) slot = htab_find_slot (index_table, &tmp, INSERT); if (slot) - *slot = new_clast_name_index (name, index); + { + if (*slot) + free (*slot); + + *slot = new_clast_name_index (name, index); + } } /* Print to stderr the element ELT. */ @@ -629,7 +634,7 @@ copy_renames (void **slot, void *s) tmp.old_name = old_name; x = htab_find_slot (res, &tmp, INSERT); - if (!*x) + if (x && !*x) *x = new_rename_map_elt (old_name, expr); return 1; @@ -660,7 +665,7 @@ mark_bb_with_pbb (poly_bb_p pbb, basic_block bb, htab_t bb_pbb_mapping) tmp.bb = bb; x = htab_find_slot (bb_pbb_mapping, &tmp, INSERT); - if (!*x) + if (x && !*x) *x = new_bb_pbb_def (bb, pbb); } @@ -1026,7 +1031,7 @@ compute_cloog_iv_types_1 (poly_bb_p pbb, struct clast_user_stmt *user_stmt) slot = htab_find_slot (GBB_CLOOG_IV_TYPES (gbb), &tmp, INSERT); - if (!*slot) + if (slot && !*slot) { tree oldiv = pbb_to_depth_to_oldiv (pbb, index); tree type = oldiv ? TREE_TYPE (oldiv) : integer_type_node; |