PR tree-optimization/78696 - [7 Regression] -fprintf-return-value misoptimizes %...
authorMartin Sebor <msebor@gcc.gnu.org>
Tue, 3 Jan 2017 23:14:44 +0000 (16:14 -0700)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 3 Jan 2017 23:14:44 +0000 (16:14 -0700)
commit5b4f088d0d203c56898f7957366255d33b6b41a6
tree5331a51b6c1ca01b2f03916a9d7018b572c715ca
parent0f2a6e84c6e4edd122228be318a014dd88d1c4f2
PR tree-optimization/78696 - [7 Regression] -fprintf-return-value misoptimizes %.Ng where N is greater than 10

gcc/ChangeLog:

PR tree-optimization/78696
* gimple-ssa-sprintf.c (format_floating): Correct handling of
precision.  Use MPFR for %f for greater fidelity.  Correct handling
of %g.
(pass_sprintf_length::compute_format_length): Set width and precision
specified by asrerisk to void_node for vararg functions.
(try_substitute_return_value): Adjust dump output.

gcc/testsuite/ChangeLog:

PR tree-optimization/78696
* gcc.dg/tree-ssa/builtin-sprintf-5.c: Remove incorrect test cases.
* gcc.dg/tree-ssa/builtin-sprintf-warn-7.c: Correct off-by-1 errors.
* gcc.dg/tree-ssa/builtin-sprintf-warn-9.c: New test.
* gcc.dg/tree-ssa/builtin-sprintf.c: Add test cases.

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