PR middle-end/84095 - false-positive -Wrestrict warnings for memcpy within array
authorMartin Sebor <msebor@redhat.com>
Tue, 20 Feb 2018 20:22:01 +0000 (20:22 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Tue, 20 Feb 2018 20:22:01 +0000 (13:22 -0700)
commit5e27f0d5d54d83e13d8b845b965b96fd10706f46
tree6f9d63e7d0aab885e612d0f3546e51175425c258
parent75b81dcdad7b41fb6cc9d0fa6064966c2016ce96
PR middle-end/84095 - false-positive -Wrestrict warnings for memcpy within array

gcc/ChangeLog:

PR middle-end/84095
* gimple-ssa-warn-restrict.c (builtin_memref::extend_offset_range): New.
(builtin_memref::set_base_and_offset): Same.  Handle inner references.
(builtin_memref::builtin_memref): Factor out parts into
set_base_and_offset and call it.

gcc/testsuite/ChangeLog:

PR middle-end/84095
* c-c++-common/Warray-bounds-3.c: Adjust text of expected warnings.
* c-c++-common/Wrestrict.c: Same.
* gcc.dg/Wrestrict-6.c: Same.
* gcc.dg/Warray-bounds-27.c: New test.
* gcc.dg/Wrestrict-8.c: New test.
* gcc.dg/Wrestrict-9.c: New test.
* gcc.dg/pr84095.c: New test.

From-SVN: r257860
gcc/ChangeLog
gcc/gimple-ssa-warn-restrict.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/Warray-bounds-3.c
gcc/testsuite/c-c++-common/Wrestrict.c
gcc/testsuite/gcc.dg/Warray-bounds-27.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wrestrict-6.c
gcc/testsuite/gcc.dg/Wrestrict-8.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/Wrestrict-9.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr84095.c [new file with mode: 0644]