PR tree-optimization/91996 - fold non-constant strlen relational expressions
authorMartin Sebor <msebor@redhat.com>
Wed, 16 Oct 2019 17:18:57 +0000 (17:18 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 16 Oct 2019 17:18:57 +0000 (11:18 -0600)
commit27c14dbc6b01d5b7238d9d6893bcddce19b7056c
tree91e41b4bdffd010279c5b4036678d1c8f93a21da
parentb7bfd3c503b063ad9bbcb975816423e82cf48636
PR tree-optimization/91996 - fold non-constant strlen relational expressions

gcc/testsuite/ChangeLog:

PR tree-optimization/91996
* gcc.dg/strlenopt-80.c: New test.
* gcc.dg/strlenopt-81.c: New test.

gcc/ChangeLog:

PR tree-optimization/91996
* tree-ssa-strlen.c (maybe_warn_pointless_strcmp): Improve location
information.
(compare_nonzero_chars): Add an overload.
(count_nonzero_bytes): Add an argument.  Call overload above.
Handle non-constant lengths in some range.
(handle_store): Add an argument.
(check_and_optimize_stmt): Pass an argument to handle_store.

From-SVN: r277076
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/strlenopt-80.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/strlenopt-81.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c