re PR middle-end/86714 (tree-ssa-forwprop.c confused by too long initializer)
authorMartin Sebor <msebor@redhat.com>
Wed, 29 Aug 2018 17:17:08 +0000 (17:17 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 29 Aug 2018 17:17:08 +0000 (11:17 -0600)
commite84bf0ef66aa72228299dd92d342c4de3a37c55c
treefa06d2fdd65f07a2e2f5dc933d8166e57ae93a5e
parentb9a0baa9f941537de5ea2c431830a8da33692d88
re PR middle-end/86714 (tree-ssa-forwprop.c confused by too long initializer)

PR tree-optimization/86714
PR tree-optimization/86711
* builtins.c (c_strlen): Add arguments to call to string_constant.
* expr.c (string_constant): Add argument.  Detect missing nul
terminator and outermost declaration it's missing in.
* expr.h (string_constant): Add argument.
* fold-const.c (read_from_constant_string): Add arguments to call to
string_constant.
(c_getstr): Likewise.
* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
to string_constant.
* tree-ssa-strlen.c (get_stridx): Likewise.

PR tree-optimization/86714
PR tree-optimization/86711
* gcc.c-torture/execute/memchr-1.c: New test.
* gcc.c-torture/execute/pr86714.c: New test.
* gcc.c-torture/execute/widechar-3.c: New test.
* gcc.dg/strlenopt-58.c: New test.

Co-Authored-By: Bernd Edlinger <bernd.edlinger@hotmail.de>
Co-Authored-By: Jeff Law <law@redhat.com>
From-SVN: r263963
12 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/expr.c
gcc/expr.h
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/memchr-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr86714.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/widechar-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-58.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-strlen.c