public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3929] [frange] Avoid testing signed zero test for -fno-signed-zeros.
@ 2022-11-12 10:29 Aldy Hernandez
  0 siblings, 0 replies; only message in thread
From: Aldy Hernandez @ 2022-11-12 10:29 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f232715d15618e91c90eb210e23de10909590944

commit r13-3929-gf232715d15618e91c90eb210e23de10909590944
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Sat Nov 12 11:27:49 2022 +0100

    [frange] Avoid testing signed zero test for -fno-signed-zeros.
    
    This patch moves a test that is meant to only work for signed zeros
    into range_tests_signed_zeros.
    
    I am not aware of any architectures where this is failing, but it is
    annoying to see selftests failing when -fno-signed-zeros is used.
    
    gcc/ChangeLog:
    
            * value-range.cc (range_tests_signbit): Move to set from here...
            (range_tests_signed_zeros): ...to here.

Diff:
---
 gcc/value-range.cc | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/value-range.cc b/gcc/value-range.cc
index d55d85846c1..34fac636cad 100644
--- a/gcc/value-range.cc
+++ b/gcc/value-range.cc
@@ -3928,6 +3928,11 @@ range_tests_signed_zeros ()
   r0.set_nonnegative (float_type_node);
   if (HONOR_NANS (float_type_node))
     ASSERT_TRUE (r0.maybe_isnan ());
+
+  // Numbers containing zero should have an unknown SIGNBIT.
+  r0 = frange_float ("0", "10");
+  r0.clear_nan ();
+  ASSERT_TRUE (r0.signbit_p (signbit) && !signbit);
 }
 
 static void
@@ -3944,10 +3949,6 @@ range_tests_signbit ()
   r0 = frange_float ("1", "10");
   r0.clear_nan ();
   ASSERT_TRUE (r0.signbit_p (signbit) && !signbit);
-  // Numbers containing zero should have an unknown SIGNBIT.
-  r0 = frange_float ("0", "10");
-  r0.clear_nan ();
-  ASSERT_TRUE (r0.signbit_p (signbit) && !signbit);
   // Numbers spanning both positive and negative should have an
   // unknown SIGNBIT.
   r0 = frange_float ("-10", "10");

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-12 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-12 10:29 [gcc r13-3929] [frange] Avoid testing signed zero test for -fno-signed-zeros Aldy Hernandez

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