PR middle-end/94647 - bogus -Warray-bounds on strncpy into a larger member array...
authorMartin Sebor <msebor@redhat.com>
Tue, 21 Apr 2020 16:59:24 +0000 (10:59 -0600)
committerMartin Sebor <msebor@redhat.com>
Tue, 21 Apr 2020 17:11:06 +0000 (11:11 -0600)
commit3942060c4b3168307b9e2870d81e7ca15b49760a
tree63775e1c15a45fc845647576c47d8e22cd3a4620
parentfb22faf48f6eb518932f24005f8606e5f19a7304
PR middle-end/94647 - bogus -Warray-bounds on strncpy into a larger member array from a smaller array

gcc/ChangeLog:

PR middle-end/94647
* gimple-ssa-warn-restrict.c (builtin_access::builtin_access): Correct
the computation of the lower bound of the source access size.
(builtin_access::generic_overlap): Remove a hack for setting ranges
of overlap offsets.

gcc/testsuite/ChangeLog:

PR middle-end/94647
* c-c++-common/Warray-bounds-2.c: Adjust a test case and add a new one.
* c-c++-common/Warray-bounds-3.c: Add tests for missing warnings.
* c-c++-common/Wrestrict.c: Invert bounds in printed ranges.
* gcc.dg/Warray-bounds-59.c: New test.
* gcc.dg/Wrestrict-10.c: Add a missing warning.
* gcc.dg/Wrestrict-5.c: Adjust text of expected warning.
* gcc.dg/Wrestrict-6.c: Expect to see a range of overlap offsets.
gcc/ChangeLog
gcc/gimple-ssa-warn-restrict.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Warray-bounds-2.c
gcc/testsuite/c-c++-common/Warray-bounds-3.c
gcc/testsuite/c-c++-common/Wrestrict.c
gcc/testsuite/gcc.dg/Warray-bounds-59.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wrestrict-10.c
gcc/testsuite/gcc.dg/Wrestrict-5.c
gcc/testsuite/gcc.dg/Wrestrict-6.c