This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Optimize away useless snprintf calls with -fprintf-return-value (take 2)


On 01/10/2017 12:23 AM, Jakub Jelinek wrote:
On Mon, Jan 02, 2017 at 04:54:57PM -0700, Martin Sebor wrote:
Looks good to me, thanks!  Just a couple of suggestions:

Here is updated patch with those added comments (and adjusted for the
current trunk).  Ok for trunk?

2017-01-10  Jakub Jelinek  <jakub@redhat.com>

	* gimple-ssa-sprintf.c (try_substitute_return_value): Remove
	info.nowrite calls with no lhs that can't throw.  Return bool
	whether gsi_remove has been called or not.
	(pass_sprintf_length::handle_gimple_call): Return bool whether
	try_substitute_return_value called gsi_remove.  Formatting fix.
	(pass_sprintf_length::execute): Don't use gsi_remove if
	handle_gimple_call returned true.

	* gcc.dg/tree-ssa/builtin-snprintf-1.c: New test.
OK.
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]