This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] correct -Wrestrict handling of arrays of arrays (PR 84095)
- From: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- To: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 23 Feb 2018 08:47:35 +0530
- Subject: Re: [PATCH] correct -Wrestrict handling of arrays of arrays (PR 84095)
- Authentication-results: sourceware.org; auth=none
- References: <b65fa4a4-a823-4b72-0cb2-751a430301bf@gmail.com> <ddd30be9-e153-9ff9-bad8-59aab24b6256@gmail.com>
On Friday 02 February 2018 05:15 AM, Martin Sebor wrote:
> 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.
This is causing failures in Warray-bounds-2.c in the testsuite:
FAIL: c-c++-common/Warray-bounds-2.c -Wc++-compat memcpy (test for
warnings, line 67)
FAIL: c-c++-common/Warray-bounds-2.c -Wc++-compat (test for warnings,
line 72)
FAIL: c-c++-common/Warray-bounds-2.c -Wc++-compat strncpy (test for
warnings, line 178)
FAIL: c-c++-common/Warray-bounds-2.c -Wc++-compat (test for warnings,
line 183)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++98 memcpy (test for
warnings, line 67)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++98 (test for warnings,
line 72)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++98 strncpy (test for
warnings, line 178)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++98 (test for warnings,
line 183)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++11 memcpy (test for
warnings, line 67)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++11 (test for warnings,
line 72)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++11 strncpy (test for
warnings, line 178)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++11 (test for warnings,
line 183)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++14 memcpy (test for
warnings, line 67)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++14 (test for warnings,
line 72)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++14 strncpy (test for
warnings, line 178)
FAIL: c-c++-common/Warray-bounds-2.c -std=gnu++14 (test for warnings,
line 183)
Siddhesh