diff options
author | Martin Sebor <msebor@redhat.com> | 2021-03-08 13:28:52 -0700 |
---|---|---|
committer | Martin Sebor <msebor@redhat.com> | 2021-03-08 13:28:52 -0700 |
commit | 7f5ff78ff3f971c11ec67f422b2fd34281db9123 (patch) | |
tree | b7458cb5524353d63a17efea75f21868f8259978 /gcc/fortran/data.c | |
parent | b64551af5159ea30b5941ddd430001b13936822c (diff) | |
download | gcc-7f5ff78ff3f971c11ec67f422b2fd34281db9123.zip gcc-7f5ff78ff3f971c11ec67f422b2fd34281db9123.tar.gz gcc-7f5ff78ff3f971c11ec67f422b2fd34281db9123.tar.bz2 |
PR middle-end/97631 - bogus "writing one too many bytes" warning for memcpy with strlen argument
gcc/ChangeLog:
PR middle-end/97631
* tree-ssa-strlen.c (maybe_warn_overflow): Test rawmem.
(handle_builtin_stxncpy_strncat): Rename locals. Determine
destination size from allocation calls. Issue a more appropriate
kind of warning.
(handle_builtin_memcpy): Pass true as rawmem to maybe_warn_overflow.
(handle_builtin_memset): Same.
gcc/testsuite/ChangeLog:
PR middle-end/97631
* c-c++-common/Wstringop-overflow.c: Remove unexpected warnings.
Add an xfail.
* c-c++-common/Wstringop-truncation.c: Add expected warnings.
* gcc.dg/Wstringop-overflow-10.c: Also enable -Wstringop-truncation.
* gcc.dg/Wstringop-overflow-66.c: New test.
* gcc.dg/tree-ssa/strncpy-2.c: Adjust expected warning.
Diffstat (limited to 'gcc/fortran/data.c')
0 files changed, 0 insertions, 0 deletions