PR tree-optimization/79352 - -fprintf-return-value doesn't handle flexible-like array...
authorMartin Sebor <msebor@redhat.com>
Fri, 3 Feb 2017 16:38:15 +0000 (16:38 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 3 Feb 2017 16:38:15 +0000 (09:38 -0700)
commit3f3430400b2ce552a5dbdae49a3a482687b96afa
treec78749d08d207350d71edfc1c5b9871d422a1f1c
parent46a2ab580a762b0fc3e64dc4ab24d459a4bd1fd2
PR tree-optimization/79352 - -fprintf-return-value doesn't handle flexible-like array members properly

gcc/ChangeLog:

PR tree-optimization/79352
* gimple-fold.c (get_range_strlen): Add argument.
(get_range_strlen): Change return type to bool.
(get_maxval_strlen): Pass in a dummy argument.
* gimple-fold.h (get_range_strlen): Change return type to bool.
* gimple-ssa-sprintf.c (get_string_length): Set unlikely counter.
* tree.h (array_at_struct_end_p): Add argument.
* tree.c (array_at_struct_end_p): Handle it.

gcc/testsuite/ChangeLog:

PR tree-optimization/79352
* gcc.dg/tree-ssa/pr79352.c: New test.

From-SVN: r245156
gcc/ChangeLog
gcc/gimple-fold.c
gcc/gimple-fold.h
gcc/gimple-ssa-sprintf.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr79352.c [new file with mode: 0644]
gcc/tree.c
gcc/tree.h