public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Fix gfortran.dg/ieee/signaling_?.f90 tests for x86 targets
@ 2022-01-27 19:46 Uros Bizjak
  2022-01-27 21:03 ` FX
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2022-01-27 19:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: Fortran List, FX

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

As stated in signaling_?.f90 tests, x86-32 ABI is not suitable to
correctly handle signaling NaNs.  However, XFAIL is not the correct choice
to disable these tests, since various optimizations can generate code
that avoids moves from registers to memory (and back), resulting
in the code that executes correctly, producing spurious XFAIL.
These tests should be disabled on x86-32 using { ! ia32 } dg-directive
which rules out x32 ilp32 ABI, where tests execute without problems.

Please note that check_effective_target_ia32 test tries to compile code that
uses __i386__ target-dependent preprocessor definition, so it is guaranteed
to fail on all non-ia32 targets.

2022-01-27  Uroš Bizjak  <ubizjak@gmail.com>

gcc/testsuite/ChangeLog:

    * gfortran.dg/ieee/signaling_1.f90 (dg-do):
    Run only on non-ia32 targets.
    * gfortran.dg/ieee/signaling_2.f90 (dg-do): Ditto.
    * gfortran.dg/ieee/signaling_3.f90 (dg-do): Ditto.

Tested on x86_64-linux-gnu {,-m32}.

OK for master?

Uros.

[-- Attachment #2: t.diff.txt --]
[-- Type: text/plain, Size: 1393 bytes --]

diff --git a/gcc/testsuite/gfortran.dg/ieee/signaling_1.f90 b/gcc/testsuite/gfortran.dg/ieee/signaling_1.f90
index 2b156811c1e..19fee283f54 100644
--- a/gcc/testsuite/gfortran.dg/ieee/signaling_1.f90
+++ b/gcc/testsuite/gfortran.dg/ieee/signaling_1.f90
@@ -1,4 +1,4 @@
-! { dg-do run { xfail { { i?86-*-* x86_64-*-* } && ilp32 } } }
+! { dg-do run { target { ! ia32 } } }
 ! x87 / x86-32 ABI is unsuitable for signaling NaNs
 !
 ! { dg-additional-sources signaling_1_c.c }
diff --git a/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90 b/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90
index ee3805272a0..03b04c783eb 100644
--- a/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90
+++ b/gcc/testsuite/gfortran.dg/ieee/signaling_2.f90
@@ -1,4 +1,4 @@
-! { dg-do run { xfail { { i?86-*-* x86_64-*-* } && ilp32 } } }
+! { dg-do run { target { ! ia32 } } }
 ! x87 / x86-32 ABI is unsuitable for signaling NaNs
 !
 ! { dg-require-effective-target issignaling } */
diff --git a/gcc/testsuite/gfortran.dg/ieee/signaling_3.f90 b/gcc/testsuite/gfortran.dg/ieee/signaling_3.f90
index 22b36980896..ff2585d2589 100644
--- a/gcc/testsuite/gfortran.dg/ieee/signaling_3.f90
+++ b/gcc/testsuite/gfortran.dg/ieee/signaling_3.f90
@@ -1,4 +1,4 @@
-! { dg-do run { xfail { { i?86-*-* x86_64-*-* } && ilp32 } } }
+! { dg-do run { target { ! ia32 } } }
 ! x87 / x86-32 ABI is unsuitable for signaling NaNs
 !
 program test

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

* Re: [PATCH] testsuite: Fix gfortran.dg/ieee/signaling_?.f90 tests for x86 targets
  2022-01-27 19:46 [PATCH] testsuite: Fix gfortran.dg/ieee/signaling_?.f90 tests for x86 targets Uros Bizjak
@ 2022-01-27 21:03 ` FX
  0 siblings, 0 replies; 2+ messages in thread
From: FX @ 2022-01-27 21:03 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches, Fortran List

Hi Uroš,

> Please note that check_effective_target_ia32 test tries to compile code that
> uses __i386__ target-dependent preprocessor definition, so it is guaranteed
> to fail on all non-ia32 targets.

Thanks, I didn’t know the difference!
OK to push.

FX

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

end of thread, other threads:[~2022-01-27 21:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 19:46 [PATCH] testsuite: Fix gfortran.dg/ieee/signaling_?.f90 tests for x86 targets Uros Bizjak
2022-01-27 21:03 ` FX

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