PR tree-optimization/89644 - False-positive -Warray-bounds diagnostic on strncpy
authorMartin Sebor <msebor@redhat.com>
Tue, 19 Mar 2019 17:45:34 +0000 (17:45 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 19 Mar 2019 17:45:34 +0000 (11:45 -0600)
commite3ba46bd52f9bd6db8788384dd186c9ba5963129
tree5f4bc3c12380a6768864bf49672216e0763845a4
parent2214085affb80feb19e79882ee769e28c2a85a5a
PR tree-optimization/89644 - False-positive -Warray-bounds diagnostic on strncpy

gcc/ChangeLog:

PR tree-optimization/89644
* tree-ssa-strlen.c (handle_builtin_stxncpy): Consider unterminated
arrays in determining sequence sizes in strncpy and stpncpy.

gcc/testsuite/ChangeLog:

PR tree-optimization/89644
* gcc.dg/Wstringop-truncation-8.c: New test.

From-SVN: r269807
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wstringop-truncation-8.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c