PR tree-optimization/79699 - small memory leak in MPFR gcc/ChangeLog: PR tree-optimization/79699 * context.c (context::~context): Free MPFR caches to avoid a memory leak on program exit. diff --git a/gcc/context.c b/gcc/context.c index a7ded9c..d2009b9 100644 --- a/gcc/context.c +++ b/gcc/context.c @@ -23,6 +23,7 @@ along with GCC; see the file COPYING3. If not see #include "context.h" #include "pass_manager.h" #include "dumpfile.h" +#include "mpfr.h" /* The singleton holder of global state: */ gcc::context *g; @@ -42,4 +43,7 @@ gcc::context::~context () { delete m_passes; delete m_dumps; + + /* Release MPFR caches to avoid Valgrind leak reports. */ + mpfr_free_cache (); }