PR tree-optimization/79699 - small memory leak in MPFR

gcc/ChangeLog:
	* context.c (context::~context): Free MPFR caches to avoid
	a memory leak on program exit.

From-SVN: r245878
This commit is contained in:
Martin Sebor 2017-03-03 16:35:00 +00:00 committed by Martin Sebor
parent d9074b2959
commit da7c751ba7
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-03-03 Martin Sebor <msebor@redhat.com>
PR tree-optimization/79699
* context.c (context::~context): Free MPFR caches to avoid
a memory leak on program exit.
2017-03-03 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64.c (aarch64_float_const_representable_p):

View File

@ -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 "realmpfr.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 ();
}