The uses of MPFR in gimple-ssa-sprintf.c apparently cause the library to allocates some internal caches that it then leaks on program exit, causing Valgrind memory leak errors. The MPFR manual "strongly advises to [call mpfr_free_cache] before terminating a thread, or before exiting when using tools like 'valgrind' (to avoid memory leaks being reported)) so the attached patch does just that. It' seems like an obvious fix that could presumably be committed without a review or approval but I'd like to give others a chance to comment on the placement of the call and whether it should be guarded by ENABLE_VALGRIND_ANNOTATIONS. Joseph, since you commented on the bug, do you have a suggestion for a different site for it or a guard? The only other call to the function is in the Fortran FE and it's neither guarded nor does it appear to ever be called. Thanks Martin