This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Fix memory leak in tree-data-ref.c
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Sebastian Pop" <sebpop at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 16 Jan 2008 10:40:49 +0100
- Subject: Re: [patch] Fix memory leak in tree-data-ref.c
- References: <cb9d34b20801152314v6c49d303u7d37e7879b9228cd@mail.gmail.com>
On Jan 16, 2008 8:14 AM, Sebastian Pop <sebpop@gmail.com> wrote:
> Hi,
>
> Using the testcase from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23821
> there is a memory leak when compiled with -O3:
>
> valgrind --leak-check=full cc1 -O3 pr23821.c
>
> ==16671== 24 bytes in 2 blocks are definitely lost in loss record 1 of 6
> ==16671== at 0x401C6CA: calloc (vg_replace_malloc.c:279)
> ==16671== by 0x8A36277: xcalloc (xmalloc.c:162)
> ==16671== by 0x84CC080: conflict_fn_not_known (tree-data-ref.c:1064)
> ==16671== by 0x84CD698: initialize_data_dependence_relation
> (tree-data-ref.c:1321)
> ==16671== by 0x84D8EEA: compute_all_dependences (tree-data-ref.c:3939)
> ==16671== by 0x84DA22A: compute_data_dependences_for_loop
> (tree-data-ref.c:4169)
> ==16671== by 0x8538F2D: tree_predictive_commoning_loop (tree-predcom.c:2496)
> ==16671== by 0x85392F9: tree_predictive_commoning (tree-predcom.c:2605)
> ==16671== by 0x86061EA: run_tree_predictive_commoning (tree-ssa-loop.c:183)
> ==16671== by 0x83DB9F9: execute_one_pass (passes.c:1118)
> ==16671== by 0x83DBB49: execute_pass_list (passes.c:1171)
> ==16671== by 0x83DBB65: execute_pass_list (passes.c:1172)
>
> Fixed by the attached patch. I'm regstrapping the patch on i686-linux.
Looks good.
Thanks,
Richard.