This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I noticed this leak while looking for leaks on the tree-ssa. Basically in eliminate_partially_redundant_loads, the memory that was allocated was not freed at all.
OK to commit? Bootstrapped on powerpc-apple-darwin and i686-pc-linux-gnu with no regressions.
Thanks, Andrew Pinski
Patch: Index: gcse.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/gcse.c,v retrieving revision 1.205.2.38 diff -u -p -r1.205.2.38 gcse.c --- gcse.c 29 Apr 2004 19:44:29 -0000 1.205.2.38 +++ gcse.c 10 May 2004 04:10:20 -0000 @@ -8398,14 +8398,14 @@ eliminate_partially_redundant_loads (bas
if (ok_count < GCSE_AFTER_RELOAD_CRITICAL_FRACTION * critical_count) - return; + goto cleanup;
/* Generate moves to the loaded register from where the memory is available. */ @@ -8458,6 +8458,22 @@ eliminate_partially_redundant_loads (bas delete_insn (insn); else a_occr->deleted_p = 1; + +cleanup: + + while (unavail_occrs) + { + struct unoccr *temp = unavail_occrs->next; + free (unavail_occrs); + unavail_occrs = temp; + } + + while (avail_occrs) + { + struct unoccr *temp = avail_occrs->next; + free (avail_occrs); + avail_occrs = temp; + } }
Attachment:
leaksgcse.diff.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |