public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [testsuite PATCH] Fix -m32 gcc.target/i386/pr102464-vrndscaleph.c on RedHat.
@ 2024-06-30 11:29 Roger Sayle
  2024-07-01  1:48 ` Hongtao Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Roger Sayle @ 2024-06-30 11:29 UTC (permalink / raw)
  To: gcc-patches; +Cc: 'Hongtao Liu'

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


This patch fixes the 4 FAILs of gcc.target/i386/pr192464-vrndscaleph.c
with --target_board='unix{-m32}' on RedHat 7.x.  The issue is that this
AVX512 test includes the system math.h, and on older systems this provides
inline versions of floor, ceil and rint (for the 387).  The work around
is to define __NO_MATH_INLINES before #include <math.h> (or alternatively
use __builtin_floor, __builtin_ceil, etc.).

This patch has been tested on x86_64-pc-linux-gnu with make -k check,
with and without --target_board=unix{-m32}.  Ok for mainline?


2024-06-30  Roger Sayle  <roger@nextmovesoftware.com>

gcc/testsuite/ChangeLog
        PR middle-end/102464
        * gcc.target/i386/pr102464-vrndscaleph.c: Define __NO_MATH_INLINES
        to resovle FAILs with -m32 on older RedHat systems.


Thanks in advance,
Roger
--


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 560 bytes --]

diff --git a/gcc/testsuite/gcc.target/i386/pr102464-vrndscaleph.c b/gcc/testsuite/gcc.target/i386/pr102464-vrndscaleph.c
index a76d9e7..9eb8124 100644
--- a/gcc/testsuite/gcc.target/i386/pr102464-vrndscaleph.c
+++ b/gcc/testsuite/gcc.target/i386/pr102464-vrndscaleph.c
@@ -1,6 +1,9 @@
 /* PR target/102464.  */
 /* { dg-do compile } */
 /* { dg-options "-Ofast -mavx512fp16 -mavx512vl -mprefer-vector-width=512" } */
+#ifndef __NO_MATH_INLINES
+#define __NO_MATH_INLINES
+#endif
 #include<math.h>
 void
 foo (_Float16* __restrict a, _Float16* b)

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

* Re: [testsuite PATCH] Fix -m32 gcc.target/i386/pr102464-vrndscaleph.c on RedHat.
  2024-06-30 11:29 [testsuite PATCH] Fix -m32 gcc.target/i386/pr102464-vrndscaleph.c on RedHat Roger Sayle
@ 2024-07-01  1:48 ` Hongtao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Hongtao Liu @ 2024-07-01  1:48 UTC (permalink / raw)
  To: Roger Sayle; +Cc: gcc-patches

On Sun, Jun 30, 2024 at 7:29 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> This patch fixes the 4 FAILs of gcc.target/i386/pr192464-vrndscaleph.c
> with --target_board='unix{-m32}' on RedHat 7.x.  The issue is that this
> AVX512 test includes the system math.h, and on older systems this provides
> inline versions of floor, ceil and rint (for the 387).  The work around
> is to define __NO_MATH_INLINES before #include <math.h> (or alternatively
> use __builtin_floor, __builtin_ceil, etc.).
>
> This patch has been tested on x86_64-pc-linux-gnu with make -k check,
> with and without --target_board=unix{-m32}.  Ok for mainline?
LGTM.
>
>
> 2024-06-30  Roger Sayle  <roger@nextmovesoftware.com>
>
> gcc/testsuite/ChangeLog
>         PR middle-end/102464
>         * gcc.target/i386/pr102464-vrndscaleph.c: Define __NO_MATH_INLINES
>         to resovle FAILs with -m32 on older RedHat systems.
>
>
> Thanks in advance,
> Roger
> --
>


-- 
BR,
Hongtao

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

end of thread, other threads:[~2024-07-01  1:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-30 11:29 [testsuite PATCH] Fix -m32 gcc.target/i386/pr102464-vrndscaleph.c on RedHat Roger Sayle
2024-07-01  1:48 ` Hongtao Liu

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