PR tree-optimization/86204 - wrong strlen result after prior strnlen
authorMartin Sebor <msebor@redhat.com>
Mon, 25 Jun 2018 20:46:45 +0000 (20:46 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Mon, 25 Jun 2018 20:46:45 +0000 (14:46 -0600)
commitb36bc89e32a52ac41b6b68d834c7692b890741e6
tree5b89ff8ce0de4a470d9653841c70fa1d0d32d042
parent03cd7d3fa2d756cb4fb7d62d4aba277893932ace
PR tree-optimization/86204 -  wrong strlen result after prior strnlen

gcc/ChangeLog:

PR tree-optimization/86204
* tree-ssa-strlen.c (handle_builtin_strlen): Avoid storing
a strnlen result if it's less than the length of the string.

gcc/testsuite/ChangeLog:

PR tree-optimization/86204
* gcc.dg/strlenopt-46.c: New test.

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