PR tree-optimization/79327
commitf0775220a033740c10c081c7bd6dca0cb031e4ce
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Feb 2017 19:16:39 +0000 (3 19:16 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 3 Feb 2017 19:16:39 +0000 (3 19:16 +0000)
tree354ee345451eb296eb87adff9df1b1c87ad8b2ef
parent3bb22d5fa5f279e90cff387b5db4644a620b5576
PR tree-optimization/79327
* gimple-ssa-sprintf.c (adjust_range_for_overflow): If returning
true, always set *argmin and *argmax to TYPE_{MIN,MAX}_VALUE of
dirtype.
(format_integer): Use wide_int_to_tree instead of build_int_cst
+ to_?hwi.  If argmin is NULL, just set argmin and argmax to
TYPE_{MIN,MAX}_VALUE of argtype.  Simplify and fix computation
of shortest and longest sequence.

* gcc.dg/tree-ssa/pr79327.c: New test.
* gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
(test_sprintf_chk_hh_nonconst): Don't expect 2 bogus warnings.
* gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
(test_sprintf_chk_range_schar): Adjust dg-message.
* gcc.dg/tree-ssa/builtin-sprintf-warn-12.c: New test.
* gcc.c-torture/execute/pr79327.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@245166 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-ssa-sprintf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr79327.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-1.c
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-12.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/builtin-sprintf-warn-3.c
gcc/testsuite/gcc.dg/tree-ssa/pr79327.c [new file with mode: 0644]