S390: Fp comparison are now raising FE_INVALID with gcc 10.

Message ID b2cd1e14-f34b-6afc-da6e-d2cbac2ddac3@linux.ibm.com
State Committed
Headers

Commit Message

Stefan Liebler Oct. 29, 2019, 10:09 a.m. UTC
  Hi,

The s390 gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77918 
"S390: Floating point comparisons don't raise invalid for unordered 
operands." is fixed with gcc 10. Thus we conditionally set 
FIX_COMPARE_INVALID to 0 or 1.

Bye,
Stefan
  

Comments

Stefan Liebler Nov. 6, 2019, 7:08 a.m. UTC | #1
On 10/29/19 11:09 AM, Stefan Liebler wrote:
> Hi,
> 
> The s390 gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77918 
> "S390: Floating point comparisons don't raise invalid for unordered 
> operands." is fixed with gcc 10. Thus we conditionally set 
> FIX_COMPARE_INVALID to 0 or 1.
> 
> Bye,
> Stefan

Committed
  

Patch

commit 43006a3776e57515be633f7858438b7638b047db
Author: Stefan Liebler <stli@linux.ibm.com>
Date:   Tue Oct 29 09:12:19 2019 +0100

    S390: Fp comparison are now raising FE_INVALID with gcc 10.
    
    The s390 gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77918
    "S390: Floating point comparisons don't raise invalid for unordered operands."
    is fixed with gcc 10. Thus we conditionally set FIX_COMPARE_INVALID
    to 0 or 1.

diff --git a/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h b/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h
index dc2450cf83..440b3d0036 100644
--- a/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h
+++ b/sysdeps/s390/fpu/fix-fp-int-compare-invalid.h
@@ -27,10 +27,12 @@ 
    <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77918>.
    There exists an equivalent gcc bugzilla for Intel:
    <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52451>.
-   Once the s390 gcc bug is fixed, the definition of FIX_COMPARE_INVALID
-   should have a __GNUC_PREREQ conditional added so that e.g. the workaround
-   to call feraiseexcept (FE_INVALID) in math/s_iseqsig_template.c can be
-   avoided.  */
-#define FIX_COMPARE_INVALID 1
+   This s390 gcc bug is fixed with gcc 10, thus we don't need the workaround
+   to call feraiseexcept (FE_INVALID) in math/s_iseqsig_template.c.  */
+#if __GNUC_PREREQ (10, 0)
+# define FIX_COMPARE_INVALID 0
+#else
+# define FIX_COMPARE_INVALID 1
+#endif
 
 #endif /* fix-fp-int-compare-invalid.h */