Kaveh R. GHAZI wrote:
On Fri, 11 Jan 2008, Vincent Lefevre wrote:
==14240== at 0x4A059F6: malloc (vg_replace_malloc.c:149)
==14240== by 0xB2F778: __gmp_default_allocate (in /mnt/sdb2/obj43/gcc/f951)
==14240== by 0x4C2B62D: mpfr_init2 (init2.c:53)
==14240== by 0x4C34424: mpfr_cache (cache.c:57)
==14240== by 0x4C18E48: mpfr_log (log.c:133)
==14240== by 0x4C2A4D1: mpfr_log10 (log10.c:111)
==14240== by 0x40A29F: gfc_arith_init_1 (arith.c:165)
==14240== by 0x443BC2: gfc_init_1 (misc.c:259)
==14240== by 0x47684D: gfc_init (f95-lang.c:288)
==14240== by 0x6D74F4: toplev_main (toplev.c:2128)
==14240== by 0x3B7EC1E073: (below main) (in /lib64/libc-2.7.so)
I'd say that this is a "bug" in GCC, that doesn't call mpfr_free_cache()
before exiting. Now, this isn't really necessary in practice since the
memory will be freed anyway.
Jerry - does this fix it?
--Kaveh
2008-01-16 Kaveh R. Ghazi <[EMAIL PROTECTED]>
* toplev.c (toplev_main): Call mpfr_free_cache().
diff -rup orig/egcc-SVN20080116/gcc/toplev.c egcc-SVN20080116/gcc/toplev.c
--- orig/egcc-SVN20080116/gcc/toplev.c 2008-01-03 23:37:34.000000000 +0100
+++ egcc-SVN20080116/gcc/toplev.c 2008-01-16 06:13:24.000000000 +0100
@@ -2276,6 +2276,8 @@ toplev_main (unsigned int argc, const ch
if (!exit_after_options)
do_compile ();
+ mpfr_free_cache ();
+
if (errorcount || sorrycount)
return (FATAL_EXIT_CODE);
Hi Kaveh,
Yes this fixes the mpfr related memory leak. The cgraph related leaks are still
in trunk.
Jerry