aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-12-03 20:03:27 +0100
committerJakub Jelinek <jakub@redhat.com>2023-12-03 20:03:27 +0100
commit4c0dc30099d39ef6d1b6c8c81418c726aa660768 (patch)
treed6e0cd7ff43063ab08795af25c1d397f623d0650
parenteef6aea3052b4b8a60df211015dafcb4573d19fb (diff)
downloadgcc-4c0dc30099d39ef6d1b6c8c81418c726aa660768.zip
gcc-4c0dc30099d39ef6d1b6c8c81418c726aa660768.tar.gz
gcc-4c0dc30099d39ef6d1b6c8c81418c726aa660768.tar.bz2
testsuite: Fix up gcc.target/aarch64/pr112406.c for modern C [PR112406]
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. 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.
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr112406.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/pr112406.c b/gcc/testsuite/gcc.target/aarch64/pr112406.c
index 46459c6..f418c05 100644
--- a/gcc/testsuite/gcc.target/aarch64/pr112406.c
+++ b/gcc/testsuite/gcc.target/aarch64/pr112406.c
@@ -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, GetImageChannelMoments_M00_1,
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);
}