public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>,
	Robin Dapp <rdapp.gcc@gmail.com>,
	fweimer@tucnak.zalov.cz
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH] testsuite: Fix up gcc.target/aarch64/pr112406.c for modern C [PR112406]
Date: Sun, 3 Dec 2023 19:32:02 +0100	[thread overview]
Message-ID: <ZWzJot9+UHOofuSX@tucnak> (raw)
In-Reply-To: <5208e31f-f721-4df9-81b9-508a2e76accd@gmail.com>

On Fri, Nov 17, 2023 at 02:04:01PM +0100, Robin Dapp wrote:
> > Yes, your version is also OK.
> 
> The attached was bootstrapped and regtested on aarch64, x86 and
> regtested on riscv.  Going to commit it later unless somebody objects.

Unfortunately the aarch64/pr112406.c was reduced too much and is rejected
since the switch to modern C patchset.

The following patch fixes that, I've verified the testcase
before/after the changes still ICEs in r14-5563 and doesn't with
r14-5564 and after the changes compiles fine with even latest trunk.
Everything admittedly with a cross-compiler, but that shouldn't change
anything.

Ok for trunk?

Note, one of the modern C changes is that at least when people use
cvise/creduce/delta scripts which ensure no further errors are introduced
during the reduction then expected originally such reductions will not
appear anymore.

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

	PR middle-end/112406
	* gcc.target/aarch64/pr112406.c (MagickPixelPacket): Add missing
	semicolon.
	(GetImageChannelMoments_image): Avoid using implicit int.
	(SetMagickPixelPacket): Use void return type instead of implicit int.
	(GetImageChannelMoments): Likewise.  Use __builtin_atan instead of
	atan.

--- gcc/testsuite/gcc.target/aarch64/pr112406.c.jj	2023-11-18 09:35:20.944084686 +0100
+++ gcc/testsuite/gcc.target/aarch64/pr112406.c	2023-12-03 19:05:16.109365791 +0100
@@ -2,10 +2,10 @@
 /* { dg-options "-march=armv8-a+sve -w -Ofast" } */
 
 typedef struct {
-  int red
+  int red;
 } MagickPixelPacket;
 
-GetImageChannelMoments_image, GetImageChannelMoments_image_0,
+int GetImageChannelMoments_image, GetImageChannelMoments_image_0,
     GetImageChannelMoments___trans_tmp_1, GetImageChannelMoments_M11_0,
     GetImageChannelMoments_pixel_3, GetImageChannelMoments_y,
     GetImageChannelMoments_p;
@@ -15,10 +15,12 @@ double GetImageChannelMoments_M00_0, Get
 
 MagickPixelPacket GetImageChannelMoments_pixel;
 
+void
 SetMagickPixelPacket(int color, MagickPixelPacket *pixel) {
   pixel->red = color;
 }
 
+void
 GetImageChannelMoments() {
   for (; GetImageChannelMoments_y; GetImageChannelMoments_y++) {
     SetMagickPixelPacket(GetImageChannelMoments_p,
@@ -33,5 +35,5 @@ GetImageChannelMoments() {
     GetImageChannelMoments_M01_1 +=
         GetImageChannelMoments_y * GetImageChannelMoments_p++;
   }
-  GetImageChannelMoments___trans_tmp_1 = atan(GetImageChannelMoments_M11_0);
+  GetImageChannelMoments___trans_tmp_1 = __builtin_atan(GetImageChannelMoments_M11_0);
 }


	Jakub


WARNING: multiple messages have this Message-ID
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>,
	Robin Dapp <rdapp.gcc@gmail.com>,
	Florian Weimer <fweimer@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: [PATCH] testsuite: Fix up gcc.target/aarch64/pr112406.c for modern C [PR112406]
Date: Sun, 3 Dec 2023 19:32:28 +0100	[thread overview]
Message-ID: <ZWzJot9+UHOofuSX@tucnak> (raw)
Message-ID: <20231203183228.uM_zCMGzXPegpugusPpGdbmCq14WVEtsSxOT5kxn1qg@z> (raw)
In-Reply-To: <5208e31f-f721-4df9-81b9-508a2e76accd@gmail.com>

On Fri, Nov 17, 2023 at 02:04:01PM +0100, Robin Dapp wrote:
> > Yes, your version is also OK.
> 
> The attached was bootstrapped and regtested on aarch64, x86 and
> regtested on riscv.  Going to commit it later unless somebody objects.

Unfortunately the aarch64/pr112406.c was reduced too much and is rejected
since the switch to modern C patchset.

The following patch fixes that, I've verified the testcase
before/after the changes still ICEs in r14-5563 and doesn't with
r14-5564 and after the changes compiles fine with even latest trunk.
Everything admittedly with a cross-compiler, but that shouldn't change
anything.

Ok for trunk?

Note, one of the modern C changes is that at least when people use
cvise/creduce/delta scripts which ensure no further errors are introduced
during the reduction then expected originally such reductions will not
appear anymore.

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

	PR middle-end/112406
	* gcc.target/aarch64/pr112406.c (MagickPixelPacket): Add missing
	semicolon.
	(GetImageChannelMoments_image): Avoid using implicit int.
	(SetMagickPixelPacket): Use void return type instead of implicit int.
	(GetImageChannelMoments): Likewise.  Use __builtin_atan instead of
	atan.

--- gcc/testsuite/gcc.target/aarch64/pr112406.c.jj	2023-11-18 09:35:20.944084686 +0100
+++ gcc/testsuite/gcc.target/aarch64/pr112406.c	2023-12-03 19:05:16.109365791 +0100
@@ -2,10 +2,10 @@
 /* { dg-options "-march=armv8-a+sve -w -Ofast" } */
 
 typedef struct {
-  int red
+  int red;
 } MagickPixelPacket;
 
-GetImageChannelMoments_image, GetImageChannelMoments_image_0,
+int GetImageChannelMoments_image, GetImageChannelMoments_image_0,
     GetImageChannelMoments___trans_tmp_1, GetImageChannelMoments_M11_0,
     GetImageChannelMoments_pixel_3, GetImageChannelMoments_y,
     GetImageChannelMoments_p;
@@ -15,10 +15,12 @@ double GetImageChannelMoments_M00_0, Get
 
 MagickPixelPacket GetImageChannelMoments_pixel;
 
+void
 SetMagickPixelPacket(int color, MagickPixelPacket *pixel) {
   pixel->red = color;
 }
 
+void
 GetImageChannelMoments() {
   for (; GetImageChannelMoments_y; GetImageChannelMoments_y++) {
     SetMagickPixelPacket(GetImageChannelMoments_p,
@@ -33,5 +35,5 @@ GetImageChannelMoments() {
     GetImageChannelMoments_M01_1 +=
         GetImageChannelMoments_y * GetImageChannelMoments_p++;
   }
-  GetImageChannelMoments___trans_tmp_1 = atan(GetImageChannelMoments_M11_0);
+  GetImageChannelMoments___trans_tmp_1 = __builtin_atan(GetImageChannelMoments_M11_0);
 }


	Jakub


  reply	other threads:[~2023-12-03 18:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-08 16:18 [PATCH] vect: Use statement vectype for conditional mask Robin Dapp
2023-11-10  9:33 ` Richard Biener
2023-11-16 22:30   ` Robin Dapp
2023-11-17  8:24     ` Richard Biener
2023-11-17  8:45       ` Robin Dapp
2023-11-17  8:47         ` Richard Biener
2023-11-17 13:04           ` Robin Dapp
2023-12-03 18:32             ` Jakub Jelinek [this message]
2023-12-03 18:32               ` [PATCH] testsuite: Fix up gcc.target/aarch64/pr112406.c for modern C [PR112406] Jakub Jelinek
2023-12-03 18:59               ` Richard Biener
2023-11-17 19:20       ` [PATCH] vect: Use statement vectype for conditional mask Robin Dapp
2023-11-20  8:03         ` Richard Biener

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=ZWzJot9+UHOofuSX@tucnak \
    --to=jakub@redhat.com \
    --cc=fweimer@tucnak.zalov.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rdapp.gcc@gmail.com \
    --cc=rguenther@suse.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).