PR tree-optimization/85700 - Spurious -Wstringop-truncation warning with strncat
authorMartin Sebor <msebor@redhat.com>
Mon, 25 Jun 2018 20:33:28 +0000 (20:33 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Mon, 25 Jun 2018 20:33:28 +0000 (14:33 -0600)
commiteec5f615cbad2de5ff10fbaa8c92f68cc5c6be00
tree6d97fc1ae9f1316ba96cf9579500332267bb075a
parent2bcd87a7b5bf793a00e99a5d7fdef4277afa7dc6
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.

From-SVN: r262110
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