PR tree-optimization/84468 - bogus -Wstringop-truncation despite assignment after...
commitdc4a43f21b0aa4eb16cf1a2958edfff6de8d020a
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Mar 2018 19:30:31 +0000 (7 19:30 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 7 Mar 2018 19:30:31 +0000 (7 19:30 +0000)
tree06a0c23188ccd0d051f0d12c261d793b03baaa68
parent720d31166435c7d4446bc6323301914cd52fcdab
PR tree-optimization/84468 - bogus -Wstringop-truncation despite assignment after conditional strncpy

gcc/ChangeLog:

PR tree-optimization/84468
* tree-ssa-strlen.c (maybe_diag_stxncpy_trunc): Consider successor
basic block when looking for nul assignment.

gcc/testsuite/ChangeLog:

PR tree-optimization/84468
* g++.dg/warn/Wstringop-truncation-2.C: New test.
* gcc.dg/Wstringop-truncation.c: New test.
* gcc.dg/Wstringop-truncation-2.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258339 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/Wstringop-truncation-1.C
gcc/testsuite/g++.dg/warn/Wstringop-truncation-2.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wstringop-truncation-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wstringop-truncation.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c