gimple-ssa-sprintf.c (try_substitute_return_value): Remove info.nowrite calls with...
authorJakub Jelinek <jakub@redhat.com>
Thu, 12 Jan 2017 21:30:56 +0000 (22:30 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 12 Jan 2017 21:30:56 +0000 (22:30 +0100)
commit3eefa646f4c90689953d63d6ef861692a858fd61
treee30ea92b84e0d2c031c221ebdc2c4f8029c6bb83
parentb34f29a19deb8c59bd151d50435e28472f1d23ae
gimple-ssa-sprintf.c (try_substitute_return_value): Remove info.nowrite calls with no lhs that can't throw.

* 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.

From-SVN: r244384
gcc/ChangeLog
gcc/gimple-ssa-sprintf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/builtin-snprintf-1.c [new file with mode: 0644]