public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64
@ 2023-02-27 10:29 Jonathan Yong
  2023-03-29  4:48 ` Jonathan Yong
  2023-03-31  0:09 ` Mike Stump
  0 siblings, 2 replies; 4+ messages in thread
From: Jonathan Yong @ 2023-02-27 10:29 UTC (permalink / raw)
  To: Gcc Patch List

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

Attached patch OK?

     Excess errors on x86_64-w64-mingw32:
     /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:50:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=]
     /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:55:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=]
     /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:90:3: warning: array subscript 658812288346769699 is above array bounds of 'struct S16[][7]' [-Warray-bounds=]
     
     gcc/testsuite/ChangeLog:
     
             * c-c++-common/Warray-bounds.c: Fix excess warnings on
             LLP64.

[-- Attachment #2: 0001-c-c-common-Warray-bounds.c-fix-excess-warnings-on-LL.patch --]
[-- Type: text/x-patch, Size: 3559 bytes --]

From 559c2ee7cf208227e8d6c4cf7106815e45b10590 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Mon, 27 Feb 2023 10:20:52 +0000
Subject: [PATCH] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64

Excess errors on x86_64-w64-mingw32:
/home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:50:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=]
/home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:55:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=]
/home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:90:3: warning: array subscript 658812288346769699 is above array bounds of 'struct S16[][7]' [-Warray-bounds=]

gcc/testsuite/ChangeLog:

	* c-c++-common/Warray-bounds.c: Fix excess warnings on
	LLP64.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
---
 gcc/testsuite/c-c++-common/Warray-bounds.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/c-c++-common/Warray-bounds.c b/gcc/testsuite/c-c++-common/Warray-bounds.c
index 815badc0241..ce5827d6e2c 100644
--- a/gcc/testsuite/c-c++-common/Warray-bounds.c
+++ b/gcc/testsuite/c-c++-common/Warray-bounds.c
@@ -47,12 +47,12 @@ void farr_s16 (void)
   T (ax[-1]);                             /* { dg-warning "array subscript -1 is below array bounds" } */
   T (ax[0]);
 
-  T (ax[DIFF_MAX / 2 - 1]);
+  T (ax[DIFF_MAX / 2 - 1]);               /* { dg-warning "array subscript \[0-9\]+ is above array bounds" "llp64" { target llp64 } } */
   T (ax[DIFF_MAX / 2]);                   /* { dg-warning "array subscript \[0-9\]+ is above array bounds" } */
   T (ax[DIFF_MAX / 2 + (size_t)1]);       /* { dg-warning "array subscript \[0-9\]+ is above array bounds" } */
   T (ax[SIZE_MAX]);                       /* { dg-warning "array subscript \[0-9\]+ is above array bounds" } */
   T (ax[R (DIFF_MIN, -1)]);               /* { dg-warning "array subscript -1 is below array bounds" } */
-  T (ax[R (DIFF_MAX / 2 - 1, DIFF_MAX)]);
+  T (ax[R (DIFF_MAX / 2 - 1, DIFF_MAX)]); /* { dg-warning "array subscript \[0-9\]+ is above array bounds" "llp64" { target llp64 } } */
   T (ax[R (DIFF_MAX / 2, DIFF_MAX)]);     /* { dg-warning "array subscript \[0-9\]+ is above array bounds" } */
 }
 
@@ -87,7 +87,7 @@ void farr_s16_7 (void)
   T (ax_7[R (-1, DIFF_MAX)][0]);
 
   T (ax_7[R ( 1, DIFF_MAX)][0]);
-  T (ax_7[R (DIFF_MAX / 14 - 1, DIFF_MAX)][0]);
+  T (ax_7[R (DIFF_MAX / 14 - 1, DIFF_MAX)][0]); /* { dg-warning "array subscript \[0-9\]+ is above array bounds" "llp64" { target llp64 } } */
 
   i = R (DIFF_MAX / 14, DIFF_MAX);
   T (ax_7[i][0]);                         /* { dg-warning "array subscript \[0-9\]+ is above array bounds" } */
@@ -199,7 +199,7 @@ void fb (struct B *p)
 
 void f_cststring (int i)
 {
-  T (""[DIFF_MIN]);                       /* { dg-warning "array subscript -\[0-9\]+ is below array bounds of .(const )?char *\\\[1]" "string" { xfail lp64 } } */
+  T (""[DIFF_MIN]);                       /* { dg-warning "array subscript -\[0-9\]+ is below array bounds of .(const )?char *\\\[1]" "string" { xfail { lp64 || llp64 } } } */
   T (""[DIFF_MIN + 1]);                   /* { dg-warning "array subscript -\[0-9\]+ is below array bounds of .(const )?char *\\\[1]" "string" } */
   T (""[-1]);                             /* { dg-warning "array subscript -1 is below array bounds of .(const )?char *\\\[1]" "string" } */
   T (""[0]);
-- 
2.39.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64
  2023-02-27 10:29 [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64 Jonathan Yong
@ 2023-03-29  4:48 ` Jonathan Yong
  2023-03-31  0:09 ` Mike Stump
  1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Yong @ 2023-03-29  4:48 UTC (permalink / raw)
  To: Gcc Patch List; +Cc: NightStrike

On 2/27/23 10:29, Jonathan Yong wrote:
> Attached patch OK?
> 
>      Excess errors on x86_64-w64-mingw32:
>      
> /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:50:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=]
>      
> /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:55:3: warning: array subscript 4611686018427387902 is above array bounds of 'struct S16[]' [-Warray-bounds=]
>      
> /home/user/p/gcc/src/gcc-git/gcc/testsuite/c-c++-common/Warray-bounds.c:90:3: warning: array subscript 658812288346769699 is above array bounds of 'struct S16[][7]' [-Warray-bounds=]
>      gcc/testsuite/ChangeLog:
>              * c-c++-common/Warray-bounds.c: Fix excess warnings on
>              LLP64.

Ping?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64
  2023-02-27 10:29 [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64 Jonathan Yong
  2023-03-29  4:48 ` Jonathan Yong
@ 2023-03-31  0:09 ` Mike Stump
  2023-03-31  4:09   ` Jonathan Yong
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Stump @ 2023-03-31  0:09 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: Gcc Patch List

On Feb 27, 2023, at 2:29 AM, Jonathan Yong via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> Attached patch OK?

Ok.

>                * c-c++-common/Warray-bounds.c: Fix excess warnings on
>            LLP64.<0001-c-c-common-Warray-bounds.c-fix-excess-warnings-on-LL.patch>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64
  2023-03-31  0:09 ` Mike Stump
@ 2023-03-31  4:09   ` Jonathan Yong
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Yong @ 2023-03-31  4:09 UTC (permalink / raw)
  To: Mike Stump; +Cc: Gcc Patch List

On 3/31/23 00:09, Mike Stump wrote:
> On Feb 27, 2023, at 2:29 AM, Jonathan Yong via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>>
>> Attached patch OK?
> 
> Ok.
> 
>>                 * c-c++-common/Warray-bounds.c: Fix excess warnings on
>>             LLP64.<0001-c-c-common-Warray-bounds.c-fix-excess-warnings-on-LL.patch>
> 

Thanks for reviewing, pushed to master branch.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-31  4:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 10:29 [Patch] c-c++-common/Warray-bounds.c: fix excess warnings on LLP64 Jonathan Yong
2023-03-29  4:48 ` Jonathan Yong
2023-03-31  0:09 ` Mike Stump
2023-03-31  4:09   ` Jonathan Yong

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).