PR middle-end/91977 - missing -Wstringop-overflow on memcpy into a pointer plus offset
authorMartin Sebor <msebor@redhat.com>
Fri, 4 Oct 2019 21:29:41 +0000 (21:29 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Fri, 4 Oct 2019 21:29:41 +0000 (15:29 -0600)
commitdaa94de24b9afdf21c636532e53561aa3713910b
tree2b436d826209685743534b45bd63da62094c0b70
parent28a5fa54aa47877b6d254430adbf3ca0377beeaa
PR middle-end/91977 - missing -Wstringop-overflow on memcpy into a pointer plus offset

gcc/ChangeLog:

PR middle-end/91977
* tree-ssa-strlen.c (count_nonzero_bytes): Handle assignments with
MEM_REF right operand.  Avoid failing for MEM_REF assignments from
uninitialized objects.

gcc/testsuite/ChangeLog:

PR middle-end/91977
* gcc.dg/Wstringop-overflow-18.c: New test.

From-SVN: r276603
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Warray-bounds-18.c
gcc/testsuite/gcc.dg/Wstringop-overflow-18.c [new file with mode: 0644]
gcc/tree-ssa-strlen.c