This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: cc1 memory leaks
- To: Martin dot Stromberg at lu dot erisoft dot se
- Subject: Re: cc1 memory leaks
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 3 May 2000 23:52:40 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <200005031534.RAA02501@lws256.lu.erisoft.se>
> Let me know if this is useful, or if you want me to try something else.
I'd typically use a much deeper stack, like 12 or so.
> * This memory was allocated from:
> malloc [rtlib.o]
> xmalloc [xmalloc.c:72]
> create_edge_list [flow.c:6428]
> schedule_insns [haifa-sched.c:6903]
> rest_of_compilation [toplev.c:3232]
> finish_function [c-decl.c:6499]
It seems that the edge list created in schedule_insns insns is not
deallocated. From a shallow inspection, it appears that it is safe
to call free_edge_list right before
/* For now. This will move as more and more of haifa is converted
to using the cfg code in flow.c. */
free (dom);
I don't know this code at all; could you please try whether changing
it that way
a) makes the leak go away, and
b) still does not break the compiler (i.e. the testsuite still passes)?
> MLK: 320 bytes leaked in 4 blocks
> * This memory was allocated from:
> malloc [rtlib.o]
> xmalloc [xmalloc.c:72]
> push_string [c-typeck.c:4395]
> start_init [c-typeck.c:4940]
> yyparse [c-parse.y:994]
> compile_file [toplev.c:2262]
> * Block of 80 bytes (4 times); last block at 0x78e248
It seems that this leak is "by design": the stack is initially
created, and slots get reused as the stack shrinks and grows. The
final contents of the stack is not freed.
Regards,
Martin