public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>,
	Christophe Lyon <christophe.lyon@linaro.org>
Cc: Jeff Law <law@redhat.com>,
	Richard Biener <richard.guenther@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] avoid issuing -Warray-bounds during folding (PR 88800)
Date: Sat, 19 Jan 2019 00:03:00 -0000	[thread overview]
Message-ID: <bb754cce-27b0-696d-465b-639a95cea424@gmail.com> (raw)
In-Reply-To: <yddr2da886u.fsf@CeBiTec.Uni-Bielefeld.DE>

On 1/18/19 5:24 AM, Rainer Orth wrote:
> Hi Christophe,
> 
>> After your commit (r268037), I'm seeing excess errors on some arm targets:
>> FAIL: c-c++-common/Wrestrict.c  -Wc++-compat  (test for excess errors)
>> Excess errors:
>> /gcc/testsuite/c-c++-common/Wrestrict.c:195:3: warning: 'memcpy'
>> accessing 4 bytes at offsets [2, 3] and 0 overlaps between 1 and 2
>> bytes at offset [2, 3] [-Wrestrict]
>> /gcc/testsuite/c-c++-common/Wrestrict.c:202:3: warning: 'memcpy'
>> accessing 4 bytes at offsets [2, 3] and 0 overlaps between 1 and 2
>> bytes at offset [2, 3] [-Wrestrict]
>> /gcc/testsuite/c-c++-common/Wrestrict.c:207:3: warning: 'memcpy'
>> accessing 4 bytes at offsets [2, 3] and 0 overlaps between 1 and 2
>> bytes at offset [2, 3] [-Wrestrict]
> 
> I'm seeing the same on sparc-sun-solaris2.*, both 32 and 64-bit.
> Test results for x86_64-w64-mingw32 and ia64-suse-linux-gnu show the same
> failure.
> 
> Besides (and probably caused by the same revision), I now get
> 
> +XPASS: c-c++-common/Warray-bounds-3.c  -std=gnu++14 bug  (test for warnings, line 161)
> +XPASS: c-c++-common/Warray-bounds-3.c  -std=gnu++17 bug  (test for warnings, line 161)
> +XPASS: c-c++-common/Warray-bounds-3.c  -std=gnu++98 bug  (test for warnings, line 161)
> 
> +XPASS: c-c++-common/Warray-bounds-3.c  -Wc++-compat  bug  (test for warnings, line 161)
> 
> which is also seen on ia64-suse-linux-gnu.

I think this is the same problem as the one on arm.  The bigger patch
I posted should take care of it as well.

Martin

Index: gcc/testsuite/c-c++-common/Warray-bounds-3.c
===================================================================
--- gcc/testsuite/c-c++-common/Warray-bounds-3.c	(revision 268082)
+++ gcc/testsuite/c-c++-common/Warray-bounds-3.c	(working copy)
@@ -158,7 +158,7 @@ void test_memcpy_overflow (char *d, const char *s,
       but known access size is detected.  This works except with small
       sizes that are powers of 2 due to bug .  */
    T (char, 1, arr + SR (DIFF_MAX - 1, DIFF_MAX), s, 1);
-  T (char, 1, arr + SR (DIFF_MAX - 1, DIFF_MAX), s, 2);  /* { 
dg-warning "pointer overflow between offset \\\[\[0-9\]+, \[0-9\]+] and 
size 2 accessing array " "bug " { xfail *-*-* } } */
+  T (char, 1, arr + SR (DIFF_MAX - 1, DIFF_MAX), s, 2);  /* { 
dg-warning "pointer overflow between offset \\\[\[0-9\]+, \[0-9\]+] and 
size 2 accessing array " "bug " { xfail fold_memcpy_2 } } */
    T (char, 1, arr + SR (DIFF_MAX - 2, DIFF_MAX), s, 3);  /* { 
dg-warning "pointer overflow between offset \\\[\[0-9\]+, \[0-9\]+] and 
size 3 accessing array " "memcpy" } */
    T (char, 1, arr + SR (DIFF_MAX - 4, DIFF_MAX), s, 5);  /* { 
dg-warning "pointer overflow between offset \\\[\[0-9\]+, \[0-9\]+] and 
size 5 accessing array " "memcpy" } */
  }

  reply	other threads:[~2019-01-19  0:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15  0:07 Martin Sebor
2019-01-15 11:08 ` Richard Biener
2019-01-15 15:21   ` Martin Sebor
2019-01-17  1:14     ` Jeff Law
2019-01-17  1:51       ` Martin Sebor
2019-01-17  7:48         ` Richard Biener
2019-01-18  9:35         ` Christophe Lyon
2019-01-18 12:25           ` Rainer Orth
2019-01-19  0:03             ` Martin Sebor [this message]
2019-01-18 23:43           ` Martin Sebor
2019-01-19 16:46             ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bb754cce-27b0-696d-465b-639a95cea424@gmail.com \
    --to=msebor@gmail.com \
    --cc=christophe.lyon@linaro.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=richard.guenther@gmail.com \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).