From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 130705 invoked by alias); 23 Feb 2018 03:17:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 130692 invoked by uid 89); 23 Feb 2018 03:17:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=UD:Warray-bounds-2.c, friday X-HELO: homiemail-a82.g.dreamhost.com Received: from sub5.mail.dreamhost.com (HELO homiemail-a82.g.dreamhost.com) (208.113.200.129) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Feb 2018 03:17:41 +0000 Received: from homiemail-a82.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTP id 7D7796008431; Thu, 22 Feb 2018 19:17:39 -0800 (PST) Received: from linaro-laptop.intra.reserved-bit.com (unknown [123.252.202.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by homiemail-a82.g.dreamhost.com (Postfix) with ESMTPSA id 369E16008425; Thu, 22 Feb 2018 19:17:37 -0800 (PST) Subject: Re: [PATCH] correct -Wrestrict handling of arrays of arrays (PR 84095) To: Martin Sebor , Gcc Patch List , Jakub Jelinek References: From: Siddhesh Poyarekar Message-ID: Date: Fri, 23 Feb 2018 03:17:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg01314.txt.bz2 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