PR tree-optimization/85700 - Spurious -Wstringop-truncation warning with strncat
commiteca6fcbc52fbb80f2194e42fdd0b8997114eabf7
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 25 Jun 2018 20:33:28 +0000 (25 20:33 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 25 Jun 2018 20:33:28 +0000 (25 20:33 +0000)
tree6d97fc1ae9f1316ba96cf9579500332267bb075a
parent6a2f23192b8ddb84ce830510d1736394228de80e
PR tree-optimization/85700 - Spurious -Wstringop-truncation warning with strncat

gcc/ChangeLog:

PR tree-optimization/85700
* gimple-fold.c (gimple_fold_builtin_strncat): Adjust comment.
* tree-ssa-strlen.c (is_strlen_related_p): Handle integer subtraction.
(maybe_diag_stxncpy_trunc): Distinguish strncat from strncpy.

gcc/testsuite/ChangeLog:

PR tree-optimization/85700
* gcc.dg/Wstringop-truncation-4.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262110 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wstringop-truncation-4.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c