PR tree-optimization/84480 - bogus -Wstringop-truncation despite assignment with...
commitbcb285a0b5a8765d45cf828a175a5d053e2a1e2a
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2018 17:35:29 +0000 (22 17:35 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Feb 2018 17:35:29 +0000 (22 17:35 +0000)
tree6ddd58eb12d9e64c3ae7a6ca7afaab4501d2b47d
parent95b8f16f0c0ceef491a2b776533935877829fe0d
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257910 138bc75d-0d04-0410-961f-82ee72b054a4
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]