public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] gcc.dg/memchr-3.c: fix for LLP64
@ 2023-02-27 10:09 Jonathan Yong
  2023-02-27 16:55 ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Yong @ 2023-02-27 10:09 UTC (permalink / raw)
  To: Gcc Patch List

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

Attached patch OK?

     gcc.dg/memchr-3.c: fix for LLP64

             gcc/testsuite/ChangeLog:

             PR middle-end/97956
             * gcc.dg/memchr-3.c (memchr): fix long to size_t in
             prototype.

[-- Attachment #2: 0001-gcc.dg-memchr-3.c-fix-for-LLP64.patch --]
[-- Type: text/x-patch, Size: 891 bytes --]

From 194eb3d43964276beeaea14ebee4b241799cd966 Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Mon, 27 Feb 2023 10:02:32 +0000
Subject: [PATCH] gcc.dg/memchr-3.c: fix for LLP64

	gcc/testsuite/ChangeLog:

	PR middle-end/97956
	* gcc.dg/memchr-3.c (memchr): fix long to size_t in
	prototype.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
---
 gcc/testsuite/gcc.dg/memchr-3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/memchr-3.c b/gcc/testsuite/gcc.dg/memchr-3.c
index c38d9cf3349..c1f4e9e10dc 100644
--- a/gcc/testsuite/gcc.dg/memchr-3.c
+++ b/gcc/testsuite/gcc.dg/memchr-3.c
@@ -5,8 +5,9 @@
 
 typedef __INT8_TYPE__  int8_t;
 typedef __INT32_TYPE__ int32_t;
+typedef __SIZE_TYPE__  size_t;
 
-extern void* memchr (const void*, int, long);
+extern void* memchr (const void*, int, size_t);
 
 struct SX
 {
-- 
2.39.2


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

* Re: [Patch] gcc.dg/memchr-3.c: fix for LLP64
  2023-02-27 10:09 [Patch] gcc.dg/memchr-3.c: fix for LLP64 Jonathan Yong
@ 2023-02-27 16:55 ` Richard Sandiford
  2023-03-01 13:41   ` Jonathan Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sandiford @ 2023-02-27 16:55 UTC (permalink / raw)
  To: Jonathan Yong via Gcc-patches; +Cc: Jonathan Yong

Jonathan Yong via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> Attached patch OK?
>
>      gcc.dg/memchr-3.c: fix for LLP64
>
>              gcc/testsuite/ChangeLog:
>
>              PR middle-end/97956
>              * gcc.dg/memchr-3.c (memchr): fix long to size_t in
>              prototype.
>
> From 194eb3d43964276beeaea14ebee4b241799cd966 Mon Sep 17 00:00:00 2001
> From: Jonathan Yong <10walls@gmail.com>
> Date: Mon, 27 Feb 2023 10:02:32 +0000
> Subject: [PATCH] gcc.dg/memchr-3.c: fix for LLP64
>
> 	gcc/testsuite/ChangeLog:
>
> 	PR middle-end/97956
> 	* gcc.dg/memchr-3.c (memchr): fix long to size_t in
> 	prototype.

It looks like the current type signature could have been a deliberate
part of the test.  I think we should just skip it for LLP64 instead.
Preapproved if you agree.

Thanks,
Richard

>
> Signed-off-by: Jonathan Yong <10walls@gmail.com>
> ---
>  gcc/testsuite/gcc.dg/memchr-3.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/gcc.dg/memchr-3.c b/gcc/testsuite/gcc.dg/memchr-3.c
> index c38d9cf3349..c1f4e9e10dc 100644
> --- a/gcc/testsuite/gcc.dg/memchr-3.c
> +++ b/gcc/testsuite/gcc.dg/memchr-3.c
> @@ -5,8 +5,9 @@
>  
>  typedef __INT8_TYPE__  int8_t;
>  typedef __INT32_TYPE__ int32_t;
> +typedef __SIZE_TYPE__  size_t;
>  
> -extern void* memchr (const void*, int, long);
> +extern void* memchr (const void*, int, size_t);
>  
>  struct SX
>  {

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

* Re: [Patch] gcc.dg/memchr-3.c: fix for LLP64
  2023-02-27 16:55 ` Richard Sandiford
@ 2023-03-01 13:41   ` Jonathan Yong
  2023-03-02 10:46     ` Richard Sandiford
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Yong @ 2023-03-01 13:41 UTC (permalink / raw)
  To: Jonathan Yong via Gcc-patches, richard.sandiford

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

On 2/27/23 16:55, Richard Sandiford wrote:
> Jonathan Yong via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>> Attached patch OK?
>>
>>       gcc.dg/memchr-3.c: fix for LLP64
>>
>>               gcc/testsuite/ChangeLog:
>>
>>               PR middle-end/97956
>>               * gcc.dg/memchr-3.c (memchr): fix long to size_t in
>>               prototype.
>>
>>  From 194eb3d43964276beeaea14ebee4b241799cd966 Mon Sep 17 00:00:00 2001
>> From: Jonathan Yong <10walls@gmail.com>
>> Date: Mon, 27 Feb 2023 10:02:32 +0000
>> Subject: [PATCH] gcc.dg/memchr-3.c: fix for LLP64
>>
>> 	gcc/testsuite/ChangeLog:
>>
>> 	PR middle-end/97956
>> 	* gcc.dg/memchr-3.c (memchr): fix long to size_t in
>> 	prototype.
> 
> It looks like the current type signature could have been a deliberate
> part of the test.  I think we should just skip it for LLP64 instead.
> Preapproved if you agree.
> 
> Thanks,
> Richard
> 

Revised, account for the warning in LLP64.



[-- Attachment #2: 0006-gcc.dg-memchr-3.c-Account-for-LLP64-warnings.patch --]
[-- Type: text/x-patch, Size: 935 bytes --]

From 2dbfa538fe11c65914b28f94d066daee789f881a Mon Sep 17 00:00:00 2001
From: Jonathan Yong <10walls@gmail.com>
Date: Mon, 27 Feb 2023 10:02:32 +0000
Subject: [PATCH 6/7] gcc.dg/memchr-3.c: Account for LLP64 warnings

	gcc/testsuite/ChangeLog:

	PR middle-end/97956
	* gcc.dg/memchr-3.c (memchr): Account for LLP64 warnings.

Signed-off-by: Jonathan Yong <10walls@gmail.com>
---
 gcc/testsuite/gcc.dg/memchr-3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/memchr-3.c b/gcc/testsuite/gcc.dg/memchr-3.c
index c38d9cf3349..af1b26ef3ae 100644
--- a/gcc/testsuite/gcc.dg/memchr-3.c
+++ b/gcc/testsuite/gcc.dg/memchr-3.c
@@ -6,7 +6,7 @@
 typedef __INT8_TYPE__  int8_t;
 typedef __INT32_TYPE__ int32_t;
 
-extern void* memchr (const void*, int, long);
+extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" { target llp64 } } */
 
 struct SX
 {
-- 
2.39.2


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

* Re: [Patch] gcc.dg/memchr-3.c: fix for LLP64
  2023-03-01 13:41   ` Jonathan Yong
@ 2023-03-02 10:46     ` Richard Sandiford
  2023-03-02 13:43       ` Jonathan Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Sandiford @ 2023-03-02 10:46 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: Jonathan Yong via Gcc-patches

Jonathan Yong <10walls@gmail.com> writes:
> On 2/27/23 16:55, Richard Sandiford wrote:
>> Jonathan Yong via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>>> Attached patch OK?
>>>
>>>       gcc.dg/memchr-3.c: fix for LLP64
>>>
>>>               gcc/testsuite/ChangeLog:
>>>
>>>               PR middle-end/97956
>>>               * gcc.dg/memchr-3.c (memchr): fix long to size_t in
>>>               prototype.
>>>
>>>  From 194eb3d43964276beeaea14ebee4b241799cd966 Mon Sep 17 00:00:00 2001
>>> From: Jonathan Yong <10walls@gmail.com>
>>> Date: Mon, 27 Feb 2023 10:02:32 +0000
>>> Subject: [PATCH] gcc.dg/memchr-3.c: fix for LLP64
>>>
>>> 	gcc/testsuite/ChangeLog:
>>>
>>> 	PR middle-end/97956
>>> 	* gcc.dg/memchr-3.c (memchr): fix long to size_t in
>>> 	prototype.
>> 
>> It looks like the current type signature could have been a deliberate
>> part of the test.  I think we should just skip it for LLP64 instead.
>> Preapproved if you agree.
>> 
>> Thanks,
>> Richard
>> 
>
> Revised, account for the warning in LLP64.
>
>
> From 2dbfa538fe11c65914b28f94d066daee789f881a Mon Sep 17 00:00:00 2001
> From: Jonathan Yong <10walls@gmail.com>
> Date: Mon, 27 Feb 2023 10:02:32 +0000
> Subject: [PATCH 6/7] gcc.dg/memchr-3.c: Account for LLP64 warnings
>
> 	gcc/testsuite/ChangeLog:
>
> 	PR middle-end/97956
> 	* gcc.dg/memchr-3.c (memchr): Account for LLP64 warnings.
>
> Signed-off-by: Jonathan Yong <10walls@gmail.com>
> ---
>  gcc/testsuite/gcc.dg/memchr-3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/gcc.dg/memchr-3.c b/gcc/testsuite/gcc.dg/memchr-3.c
> index c38d9cf3349..af1b26ef3ae 100644
> --- a/gcc/testsuite/gcc.dg/memchr-3.c
> +++ b/gcc/testsuite/gcc.dg/memchr-3.c
> @@ -6,7 +6,7 @@
>  typedef __INT8_TYPE__  int8_t;
>  typedef __INT32_TYPE__ int32_t;
>  
> -extern void* memchr (const void*, int, long);
> +extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" { target llp64 } } */
>  
>  struct SX
>  {

OK, thanks.

Richard

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

* Re: [Patch] gcc.dg/memchr-3.c: fix for LLP64
  2023-03-02 10:46     ` Richard Sandiford
@ 2023-03-02 13:43       ` Jonathan Yong
  2023-03-02 23:52         ` [committed] testsuite: Fix up memchr-3.c test [PR108991] Jakub Jelinek
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Yong @ 2023-03-02 13:43 UTC (permalink / raw)
  To: Jonathan Yong via Gcc-patches, richard.sandiford

On 3/2/23 10:46, Richard Sandiford wrote:
>> diff --git a/gcc/testsuite/gcc.dg/memchr-3.c b/gcc/testsuite/gcc.dg/memchr-3.c
>> index c38d9cf3349..af1b26ef3ae 100644
>> --- a/gcc/testsuite/gcc.dg/memchr-3.c
>> +++ b/gcc/testsuite/gcc.dg/memchr-3.c
>> @@ -6,7 +6,7 @@
>>   typedef __INT8_TYPE__  int8_t;
>>   typedef __INT32_TYPE__ int32_t;
>>   
>> -extern void* memchr (const void*, int, long);
>> +extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" { target llp64 } } */
>>   
>>   struct SX
>>   {
> 
> OK, thanks.
> 
> Richard

Thanks, pushed to master branch.


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

* [committed] testsuite: Fix up memchr-3.c test [PR108991]
  2023-03-02 13:43       ` Jonathan Yong
@ 2023-03-02 23:52         ` Jakub Jelinek
  0 siblings, 0 replies; 6+ messages in thread
From: Jakub Jelinek @ 2023-03-02 23:52 UTC (permalink / raw)
  To: Jonathan Yong; +Cc: Jonathan Yong via Gcc-patches, richard.sandiford

On Thu, Mar 02, 2023 at 01:43:30PM +0000, Jonathan Yong via Gcc-patches wrote:
> On 3/2/23 10:46, Richard Sandiford wrote:
> > > diff --git a/gcc/testsuite/gcc.dg/memchr-3.c b/gcc/testsuite/gcc.dg/memchr-3.c
> > > index c38d9cf3349..af1b26ef3ae 100644
> > > --- a/gcc/testsuite/gcc.dg/memchr-3.c
> > > +++ b/gcc/testsuite/gcc.dg/memchr-3.c
> > > @@ -6,7 +6,7 @@
> > >   typedef __INT8_TYPE__  int8_t;
> > >   typedef __INT32_TYPE__ int32_t;
> > > -extern void* memchr (const void*, int, long);
> > > +extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" { target llp64 } } */
> > >   struct SX
> > >   {
> > 
> > OK, thanks.
> 
> Thanks, pushed to master branch.

The newly added dg-warning directive was missing the comment argument,
so the target selector was treated as comment and the warning was expected
on all targets when it should be expected only on llp64 targets.

Tested on x86_64-linux -m32/-m64, committed to trunk as obvious:

2023-03-03  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/108991
	* gcc.dg/memchr-3.c: Add missing comment argument to dg-warning
	before target selector.

--- gcc/testsuite/gcc.dg/memchr-3.c.jj	2023-03-02 19:09:45.466594110 +0100
+++ gcc/testsuite/gcc.dg/memchr-3.c	2023-03-03 00:48:04.368348282 +0100
@@ -6,7 +6,7 @@
 typedef __INT8_TYPE__  int8_t;
 typedef __INT32_TYPE__ int32_t;
 
-extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" { target llp64 } } */
+extern void* memchr (const void*, int, long); /* { dg-warning "-Wbuiltin-declaration-mismatch" "" { target llp64 } } */
 
 struct SX
 {


	Jakub


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

end of thread, other threads:[~2023-03-02 23:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 10:09 [Patch] gcc.dg/memchr-3.c: fix for LLP64 Jonathan Yong
2023-02-27 16:55 ` Richard Sandiford
2023-03-01 13:41   ` Jonathan Yong
2023-03-02 10:46     ` Richard Sandiford
2023-03-02 13:43       ` Jonathan Yong
2023-03-02 23:52         ` [committed] testsuite: Fix up memchr-3.c test [PR108991] Jakub Jelinek

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