PR tree-optimization/84468 - bogus -Wstringop-truncation despite assignment after...
authorMartin Sebor <msebor@redhat.com>
Wed, 7 Mar 2018 19:30:31 +0000 (19:30 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Wed, 7 Mar 2018 19:30:31 +0000 (12:30 -0700)
commita76acaedcee2e75b16adfa0112632873c1fe2e71
tree06a0c23188ccd0d051f0d12c261d793b03baaa68
parentb78b513e41b3d491efa0bd639cedbad8622a09bd
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.

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