PR tree-optimization/84480 - bogus -Wstringop-truncation despite assignment with...
authorMartin Sebor <msebor@redhat.com>
Thu, 22 Feb 2018 17:35:29 +0000 (17:35 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Thu, 22 Feb 2018 17:35:29 +0000 (10:35 -0700)
commit5d0d5d6876afa8bc773e7503ec714ac1c08ae239
tree6ddd58eb12d9e64c3ae7a6ca7afaab4501d2b47d
parent73b8b82295fb286c2d5b01c200fcd6732a96c2a8
PR tree-optimization/84480 - bogus -Wstringop-truncation despite assignment with an inlined string literal

gcc/ChangeLog:

PR tree-optimization/84480
* gimple-fold.c (gimple_fold_builtin_strcpy): Move warnings
to maybe_diag_stxncpy_trunc.  Call it.
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Integrate warnings
from gimple_fold_builtin_strcpy.  Print inlining stack.
(handle_builtin_stxncpy): Print inlining stack.
* tree-ssa-strlen.h (maybe_diag_stxncpy_trunc): Declare.

gcc/testsuite/ChangeLog:

PR tree-optimization/84480
* c-c++-common/Wstringop-truncation.c: Adjust text of expected warnings.
* g++.dg/warn/Wstringop-truncation-1.C: New test.

From-SVN: r257910
gcc/ChangeLog
gcc/gimple-fold.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Wstringop-truncation.c
gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C [new file with mode: 0644]
gcc/tree-ssa-strlen.c
gcc/tree-ssa-strlen.h [new file with mode: 0644]