public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Add testcase for sparc ICE [PR105573]
@ 2023-04-21 19:33 Sam James
  2023-04-24  7:36 ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Sam James @ 2023-04-21 19:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: pinskia, rguenth, Sam James

r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added
a test case for target/arm but the duplicate PR105573 has a test case for
target/sparc that was uncommitted until now.

2023-04-21  Sam James   <sam@gentoo.org>
        PR tree-optimization/105312
	PR target/105573
	* gcc/testsuite/gcc.target/sparc/pr105573.c: New test.

Signed-off-by: Sam James <sam@gentoo.org>
---
 gcc/testsuite/gcc.target/sparc/pr105573.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/sparc/pr105573.c

diff --git a/gcc/testsuite/gcc.target/sparc/pr105573.c b/gcc/testsuite/gcc.target/sparc/pr105573.c
new file mode 100644
index 00000000000..9eba2e4beba
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/pr105573.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mvis3" } */
+
+int *UINT_sign_args, UINT_sign_steps;
+int *UINT_sign_ip1;
+__attribute__((optimize("O3"))) void UINT_sign() {
+  char *op1 = (char*) UINT_sign_args;
+  int os1 = UINT_sign_steps, i;
+  for (; i; i++, op1 += os1) {
+    unsigned in = *(unsigned *)UINT_sign_ip1;
+    int *out = (int*) op1;
+    *out = in > 0;
+  }
+}
-- 
2.40.0


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

* Re: [PATCH] testsuite: Add testcase for sparc ICE [PR105573]
  2023-04-21 19:33 [PATCH] testsuite: Add testcase for sparc ICE [PR105573] Sam James
@ 2023-04-24  7:36 ` Richard Biener
  2023-04-24 22:29   ` Sam James
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Biener @ 2023-04-24  7:36 UTC (permalink / raw)
  To: Sam James; +Cc: gcc-patches, pinskia, rguenth

On Fri, 21 Apr 2023, Sam James wrote:

> r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added
> a test case for target/arm but the duplicate PR105573 has a test case for
> target/sparc that was uncommitted until now.

OK.  But see below for a question

> 2023-04-21  Sam James   <sam@gentoo.org>
>         PR tree-optimization/105312
> 	PR target/105573
> 	* gcc/testsuite/gcc.target/sparc/pr105573.c: New test.
> 
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
>  gcc/testsuite/gcc.target/sparc/pr105573.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>  create mode 100644 gcc/testsuite/gcc.target/sparc/pr105573.c
> 
> diff --git a/gcc/testsuite/gcc.target/sparc/pr105573.c b/gcc/testsuite/gcc.target/sparc/pr105573.c
> new file mode 100644
> index 00000000000..9eba2e4beba
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/sparc/pr105573.c
> @@ -0,0 +1,14 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O2 -mvis3" } */
> +
> +int *UINT_sign_args, UINT_sign_steps;
> +int *UINT_sign_ip1;
> +__attribute__((optimize("O3"))) void UINT_sign() {

is the optimize attribute necessary or does -O3 -mvis3 also reproduce
the issue?

> +  char *op1 = (char*) UINT_sign_args;
> +  int os1 = UINT_sign_steps, i;
> +  for (; i; i++, op1 += os1) {
> +    unsigned in = *(unsigned *)UINT_sign_ip1;
> +    int *out = (int*) op1;
> +    *out = in > 0;
> +  }
> +}

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

* Re: [PATCH] testsuite: Add testcase for sparc ICE [PR105573]
  2023-04-24  7:36 ` Richard Biener
@ 2023-04-24 22:29   ` Sam James
  2023-04-24 22:30     ` [PATCH v2] " Sam James
  0 siblings, 1 reply; 5+ messages in thread
From: Sam James @ 2023-04-24 22:29 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches, pinskia, rguenth

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


Richard Biener <rguenther@suse.de> writes:

> On Fri, 21 Apr 2023, Sam James wrote:
>
>> r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added
>> a test case for target/arm but the duplicate PR105573 has a test case for
>> target/sparc that was uncommitted until now.
>
> OK.  But see below for a question
>
>> 2023-04-21  Sam James   <sam@gentoo.org>
>>         PR tree-optimization/105312
>> 	PR target/105573
>> 	* gcc/testsuite/gcc.target/sparc/pr105573.c: New test.
>> 
>> Signed-off-by: Sam James <sam@gentoo.org>
>> ---
>>  gcc/testsuite/gcc.target/sparc/pr105573.c | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>  create mode 100644 gcc/testsuite/gcc.target/sparc/pr105573.c
>> 
>> diff --git a/gcc/testsuite/gcc.target/sparc/pr105573.c b/gcc/testsuite/gcc.target/sparc/pr105573.c
>> new file mode 100644
>> index 00000000000..9eba2e4beba
>> --- /dev/null
>> +++ b/gcc/testsuite/gcc.target/sparc/pr105573.c
>> @@ -0,0 +1,14 @@
>> +/* { dg-do compile } */
>> +/* { dg-options "-O2 -mvis3" } */
>> +
>> +int *UINT_sign_args, UINT_sign_steps;
>> +int *UINT_sign_ip1;
>> +__attribute__((optimize("O3"))) void UINT_sign() {
>
> is the optimize attribute necessary or does -O3 -mvis3 also reproduce
> the issue?

Good point - -O3 -mvis3 is enough, so I've resent w/ that & dropped
attribute.

I don't have push access so will need someone to push for me. Cheers.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 377 bytes --]

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

* [PATCH v2] testsuite: Add testcase for sparc ICE [PR105573]
  2023-04-24 22:29   ` Sam James
@ 2023-04-24 22:30     ` Sam James
  2023-04-25  6:21       ` Richard Biener
  0 siblings, 1 reply; 5+ messages in thread
From: Sam James @ 2023-04-24 22:30 UTC (permalink / raw)
  To: gcc-patches; +Cc: pinskia, rguenth, Sam James

r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added
a test case for target/arm but the duplicate PR105573 has a test case for
target/sparc that was uncommitted until now.

2023-04-21  Sam James   <sam@gentoo.org>
        PR tree-optimization/105312
	PR target/105573
	* gcc/testsuite/gcc.target/sparc/pr105573.c: New test.

Signed-off-by: Sam James <sam@gentoo.org>
---
 gcc/testsuite/gcc.target/sparc/pr105573.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/sparc/pr105573.c

diff --git a/gcc/testsuite/gcc.target/sparc/pr105573.c b/gcc/testsuite/gcc.target/sparc/pr105573.c
new file mode 100644
index 00000000000..14043a5fdad
--- /dev/null
+++ b/gcc/testsuite/gcc.target/sparc/pr105573.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mvis3" } */
+
+int *UINT_sign_args, UINT_sign_steps;
+int *UINT_sign_ip1;
+
+void UINT_sign() {
+  char *op1 = (char*) UINT_sign_args;
+  int os1 = UINT_sign_steps, i;
+  for (; i; i++, op1 += os1) {
+    unsigned in = *(unsigned *)UINT_sign_ip1;
+    int *out = (int*) op1;
+    *out = in > 0;
+  }
+}
-- 
2.40.0


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

* Re: [PATCH v2] testsuite: Add testcase for sparc ICE [PR105573]
  2023-04-24 22:30     ` [PATCH v2] " Sam James
@ 2023-04-25  6:21       ` Richard Biener
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Biener @ 2023-04-25  6:21 UTC (permalink / raw)
  To: Sam James; +Cc: gcc-patches, pinskia

On Mon, 24 Apr 2023, Sam James wrote:

> r11-10018-g33914983cf3734c2f8079963ba49fcc117499ef3 fixed PR105312 and added
> a test case for target/arm but the duplicate PR105573 has a test case for
> target/sparc that was uncommitted until now.

Pushed.

> 2023-04-21  Sam James   <sam@gentoo.org>
>         PR tree-optimization/105312
> 	PR target/105573
> 	* gcc/testsuite/gcc.target/sparc/pr105573.c: New test.
> 
> Signed-off-by: Sam James <sam@gentoo.org>
> ---
>  gcc/testsuite/gcc.target/sparc/pr105573.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 gcc/testsuite/gcc.target/sparc/pr105573.c
> 
> diff --git a/gcc/testsuite/gcc.target/sparc/pr105573.c b/gcc/testsuite/gcc.target/sparc/pr105573.c
> new file mode 100644
> index 00000000000..14043a5fdad
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/sparc/pr105573.c
> @@ -0,0 +1,15 @@
> +/* { dg-do compile } */
> +/* { dg-options "-O3 -mvis3" } */
> +
> +int *UINT_sign_args, UINT_sign_steps;
> +int *UINT_sign_ip1;
> +
> +void UINT_sign() {
> +  char *op1 = (char*) UINT_sign_args;
> +  int os1 = UINT_sign_steps, i;
> +  for (; i; i++, op1 += os1) {
> +    unsigned in = *(unsigned *)UINT_sign_ip1;
> +    int *out = (int*) op1;
> +    *out = in > 0;
> +  }
> +}
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

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

end of thread, other threads:[~2023-04-25  6:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 19:33 [PATCH] testsuite: Add testcase for sparc ICE [PR105573] Sam James
2023-04-24  7:36 ` Richard Biener
2023-04-24 22:29   ` Sam James
2023-04-24 22:30     ` [PATCH v2] " Sam James
2023-04-25  6:21       ` Richard Biener

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