diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-07 18:32:51 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-07 18:32:51 +0000 |
commit | cfd3faacbfa0ba6b08d75b41f7f876961f70337b (patch) | |
tree | 6e8b7af7a18c1c655884e15f7890e21a3bb5fd4c /gcc/graphite-interchange.c | |
parent | a1a6700b7a5a1b5911805b0e420628e45e762713 (diff) | |
download | gcc-cfd3faacbfa0ba6b08d75b41f7f876961f70337b.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155702 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-interchange.c')
-rw-r--r-- | gcc/graphite-interchange.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/graphite-interchange.c b/gcc/graphite-interchange.c index a0f84a76510..7ec7fead2f9 100644 --- a/gcc/graphite-interchange.c +++ b/gcc/graphite-interchange.c @@ -587,11 +587,20 @@ lst_perfect_nestify (lst_p loop1, lst_p loop2, lst_p *before, lst_remove_all_before_excluding_pbb (*nest, last, false); if (lst_empty_p (*before)) - *before = NULL; + { + free_lst (*before); + *before = NULL; + } if (lst_empty_p (*after)) - *after = NULL; + { + free_lst (*after); + *after = NULL; + } if (lst_empty_p (*nest)) - *nest = NULL; + { + free_lst (*nest); + *nest = NULL; + } } /* Try to interchange LOOP1 with LOOP2 for all the statements of the @@ -646,6 +655,9 @@ lst_try_interchange_loops (scop_p scop, lst_p loop1, lst_p loop2) } /* Undo the transform. */ + free_lst (before); + free_lst (nest); + free_lst (after); lst_apply_interchange (loop2, depth2, depth1); return false; } |