PR tree-optimization/78476 - snprintf(0, 0, ...) with known arguments not optimized...
authorMartin Sebor <msebor@gcc.gnu.org>
Thu, 24 Nov 2016 22:45:18 +0000 (15:45 -0700)
committerMartin Sebor <msebor@gcc.gnu.org>
Thu, 24 Nov 2016 22:45:18 +0000 (15:45 -0700)
commitd7b0fcaa39bc612b4b80fb1529d19ef3c1c842ea
tree7ee68f768e332dc043f3d3122d0c2568c3153af3
parent6f8bb7637206ba0ea0b736dc3528bbb76d074c47
PR tree-optimization/78476 - snprintf(0, 0, ...) with known arguments not optimized away

gcc/testsuite/ChangeLog:

PR tree-optimization/78476
* gcc.dg/tree-ssa/builtin-sprintf-5.c: New test.

gcc/ChangeLog:

PR tree-optimization/78476
* gimple-ssa-sprintf.c (struct pass_sprintf_length::call_info):
Add a member.
(handle_gimple_call): Adjust signature.
(try_substitute_return_value): Remove calls to bounded functions
with zero buffer size whose result is known.
(pass_sprintf_length::execute): Adjust call to handle_gimple_call.

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