PR tree-optimization/83075 - Invalid strncpy optimization
authorMartin Sebor <msebor@redhat.com>
Wed, 6 Dec 2017 17:47:45 +0000 (17:47 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 6 Dec 2017 17:47:45 +0000 (10:47 -0700)
commit25b15e953ac48e5042e27a4419ca20211403b7cb
tree8702db003aa73c7b1a8670612c78ec7cd47578ea
parent4c413747a31d0dd8ecfc05312584725d2f0955f6
PR tree-optimization/83075 - Invalid strncpy optimization

gcc/ChangeLog:

PR tree-optimization/83075
* tree-ssa-strlen.c (handle_builtin_stxncpy): Avoid assuming
strncat/strncpy don't change length of source string.

gcc/testsuite/ChangeLog:

PR tree-optimization/83075
* gcc.dg/tree-ssa/strncat.c: New test.
* gcc.dg/tree-ssa/strncpy-2.c: Same.

From-SVN: r255446
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/strncat.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/strncpy-2.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c