[gcc r17-3372] [PATCH 4/7] testsuite: request IEEE options for tests relying on NaN and infinity

Jeff Law via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:79d4b8e2b07325b652b6f3860cd3563382068621

commit r17-3372-g79d4b8e2b07325b652b6f3860cd3563382068621
Author: Matt Turner <[email protected]>
Date:   Tue Aug 18 08:34:58 2026 -0600

    [PATCH 4/7] testsuite: request IEEE options for tests relying on NaN and infinity
    
    These tests feed NaNs or infinities through floating-point comparisons.
    Alpha only generates IEEE-conformant code with -mieee: without it GCC emits
    cmpteq rather than cmpteq/su, and an invalid-operation trap on a non-finite
    operand is not software-completable, so the program dies with SIGFPE.
    
    Use dg-add-options ieee, which adds -mieee on alpha and sh, rather than
    marking the tests as expected failures.  The compiler behaves as documented
    and the tests check something meaningful once IEEE semantics are requested.
    
    gcc/testsuite/ChangeLog:
    
            * g++.dg/opt/pr94589-6.C: Add dg-add-options ieee.
            * g++.dg/torture/pr116120-2.C: Likewise.
            * gcc.c-torture/execute/20190901-1.c: Likewise.
            * gcc.dg/pr108447.c: Likewise.
            * gcc.dg/pr94589-6.c: Likewise.
            * gcc.dg/torture/pr126464.c: Likewise.
            * gcc.dg/torture/pr126576.c: Likewise.

Diff:
---
 gcc/testsuite/g++.dg/opt/pr94589-6.C             | 1 +
 gcc/testsuite/g++.dg/torture/pr116120-2.C        | 1 +
 gcc/testsuite/gcc.c-torture/execute/20190901-1.c | 1 +
 gcc/testsuite/gcc.dg/pr108447.c                  | 1 +
 gcc/testsuite/gcc.dg/pr94589-6.c                 | 1 +
 gcc/testsuite/gcc.dg/torture/pr126464.c          | 1 +
 gcc/testsuite/gcc.dg/torture/pr126576.c          | 1 +
 7 files changed, 7 insertions(+)

diff --git a/gcc/testsuite/g++.dg/opt/pr94589-6.C b/gcc/testsuite/g++.dg/opt/pr94589-6.C
index c5036c6f56a9..49d205b057a6 100644
--- a/gcc/testsuite/g++.dg/opt/pr94589-6.C
+++ b/gcc/testsuite/g++.dg/opt/pr94589-6.C
@@ -1,6 +1,7 @@
 // { dg-do run { target c++20 } }
 // { dg-require-effective-target inf }
 // { dg-options "-O2 -g" }
+// { dg-add-options ieee }
 
 #include "pr94589-5.C"
 
diff --git a/gcc/testsuite/g++.dg/torture/pr116120-2.C b/gcc/testsuite/g++.dg/torture/pr116120-2.C
index e9fee17a2620..8715582578da 100644
--- a/gcc/testsuite/g++.dg/torture/pr116120-2.C
+++ b/gcc/testsuite/g++.dg/torture/pr116120-2.C
@@ -1,4 +1,5 @@
 // { dg-do run }
+// { dg-add-options ieee }
 // PR tree-optimization/116120
 
 // The optimization for `(a ? x : y) == (b ? x : y)`
diff --git a/gcc/testsuite/gcc.c-torture/execute/20190901-1.c b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
index 2345e51896f2..08869092c787 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20190901-1.c
@@ -1,6 +1,7 @@
 /* PR target/91472 */
 /* Reported by John Paul Adrian Glaubitz <[email protected]> */
 /* { dg-require-effective-target double64plus } */
+/* { dg-add-options ieee } */
 
 #if __SIZEOF_INT__ >= 4
 typedef unsigned int gmp_uint_least32_t;
diff --git a/gcc/testsuite/gcc.dg/pr108447.c b/gcc/testsuite/gcc.dg/pr108447.c
index cfbaba6d0aaa..e7e34ca24cff 100644
--- a/gcc/testsuite/gcc.dg/pr108447.c
+++ b/gcc/testsuite/gcc.dg/pr108447.c
@@ -1,5 +1,6 @@
 /* { dg-do run } */
 /* { dg-options "-O2" } */
+/* { dg-add-options ieee } */
 
 __attribute__((noipa)) int
 foo (float x, float y)
diff --git a/gcc/testsuite/gcc.dg/pr94589-6.c b/gcc/testsuite/gcc.dg/pr94589-6.c
index 3131ab4cfae7..5828fce7f412 100644
--- a/gcc/testsuite/gcc.dg/pr94589-6.c
+++ b/gcc/testsuite/gcc.dg/pr94589-6.c
@@ -1,5 +1,6 @@
 /* { dg-do run { target inf } } */
 /* { dg-options "-O2 -g" } */
+/* { dg-add-options ieee } */
 
 #include "pr94589-5.c"
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr126464.c b/gcc/testsuite/gcc.dg/torture/pr126464.c
index c0dced1eedc0..f433caefa8e0 100644
--- a/gcc/testsuite/gcc.dg/torture/pr126464.c
+++ b/gcc/testsuite/gcc.dg/torture/pr126464.c
@@ -1,5 +1,6 @@
 /* PR tree-optimization/126464 */
 /* { dg-do run } */
+/* { dg-add-options ieee } */
 
 #if __DBL_MANT_DIG__ == 53 && __DBL_MAX_10_EXP__ == 308 \
     && __DBL_HAS_INFINITY__ && __FLT_EVAL_METHOD__ == 0
diff --git a/gcc/testsuite/gcc.dg/torture/pr126576.c b/gcc/testsuite/gcc.dg/torture/pr126576.c
index c94c74370357..a961f77552b1 100644
--- a/gcc/testsuite/gcc.dg/torture/pr126576.c
+++ b/gcc/testsuite/gcc.dg/torture/pr126576.c
@@ -1,5 +1,6 @@
 /* PR tree-optimization/126576 */
 /* { dg-do run } */
+/* { dg-add-options ieee } */
 
 #if __DBL_MANT_DIG__ == 53 && __DBL_MAX_10_EXP__ == 308 \
     && __DBL_HAS_INFINITY__ && __FLT_EVAL_METHOD__ == 0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.