Commit 0a95c7e2 by Martin Liska Committed by Martin Liska

Fix memory leaks in gimple-ssa-sprintf.c (PR tree-optimization/79339).

2017-02-03  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/79339
	* gimple-ssa-sprintf.c (format_floating_max): Call mpfr_clear.
	(format_floating): Likewise.

From-SVN: r245146
parent e806796d
2017-02-03 Martin Liska <mliska@suse.cz>
PR tree-optimization/79339
* gimple-ssa-sprintf.c (format_floating_max): Call mpfr_clear.
(format_floating): Likewise.
2017-02-03 Martin Liska <mliska@suse.cz>
PR ipa/79337
* ipa-prop.c (ipa_node_params_t::insert): Remove current
implementation.
......
......@@ -1501,7 +1501,10 @@ format_floating_max (tree type, char spec, HOST_WIDE_INT prec)
mpfr_from_real (x, &rv, GMP_RNDN);
/* Return a value one greater to account for the leading minus sign. */
return 1 + get_mpfr_format_length (x, "", prec, spec, 'D');
unsigned HOST_WIDE_INT r
= 1 + get_mpfr_format_length (x, "", prec, spec, 'D');
mpfr_clear (x);
return r;
}
/* Return a range representing the minimum and maximum number of bytes
......@@ -1739,6 +1742,7 @@ format_floating (const directive &dir, tree arg)
of the result struct. */
*minmax[i] = get_mpfr_format_length (mpfrval, fmtstr, prec[i],
dir.specifier, rndspec);
mpfr_clear (mpfrval);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment