re PR tree-optimization/91096 (Openmp vector max reduction incorrect)
authorJakub Jelinek <jakub@redhat.com>
Sat, 6 Jul 2019 07:50:44 +0000 (09:50 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 6 Jul 2019 07:50:44 +0000 (09:50 +0200)
PR tree-optimization/91096
* gcc.dg/vect/vect-simd-10.c (FLT_MIN_VALUE): Define.
(bar, main): Use it instead of -__builtin_inff ().
* gcc.dg/vect/vect-simd-14.c (FLT_MIN_VALUE): Define.
(bar, main): Use it instead of -__builtin_inff ().

From-SVN: r273156

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-simd-10.c
gcc/testsuite/gcc.dg/vect/vect-simd-14.c

index 33645b1..5a848eb 100644 (file)
@@ -1,3 +1,11 @@
+2019-07-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/91096
+       * gcc.dg/vect/vect-simd-10.c (FLT_MIN_VALUE): Define.
+       (bar, main): Use it instead of -__builtin_inff ().
+       * gcc.dg/vect/vect-simd-14.c (FLT_MIN_VALUE): Define.
+       (bar, main): Use it instead of -__builtin_inff ().
+
 2019-07-05  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/67184 (again)
index d442d6b..e49566a 100644 (file)
@@ -7,6 +7,12 @@
 #include "tree-vect.h"
 #endif
 
+#ifdef __FAST_MATH__
+#define FLT_MIN_VALUE (-__FLT_MAX__)
+#else
+#define FLT_MIN_VALUE (-__builtin_inff ())
+#endif
+
 float r = 1.0f, a[1024], b[1024];
 
 __attribute__((noipa)) void
@@ -24,7 +30,7 @@ foo (float *a, float *b)
 __attribute__((noipa)) float
 bar (void)
 {
-  float s = -__builtin_inff ();
+  float s = FLT_MIN_VALUE;
   #pragma omp simd reduction (inscan, max:s)
   for (int i = 0; i < 1024; i++)
     {
@@ -84,7 +90,7 @@ main ()
     }
   if (bar () != 592.0f)
     abort ();
-  s = -__builtin_inff ();
+  s = FLT_MIN_VALUE;
   for (int i = 0; i < 1024; ++i)
     {
       if (s < a[i])
index 43663bb..9e73792 100644 (file)
@@ -7,6 +7,12 @@
 #include "tree-vect.h"
 #endif
 
+#ifdef __FAST_MATH__
+#define FLT_MIN_VALUE (-__FLT_MAX__)
+#else
+#define FLT_MIN_VALUE (-__builtin_inff ())
+#endif
+
 float r = 1.0f, a[1024], b[1024];
 
 __attribute__((noipa)) void
@@ -24,7 +30,7 @@ foo (float *a, float *b)
 __attribute__((noipa)) float
 bar (void)
 {
-  float s = -__builtin_inff ();
+  float s = FLT_MIN_VALUE;
   #pragma omp simd reduction (inscan, max:s)
   for (int i = 0; i < 1024; i++)
     {
@@ -82,7 +88,7 @@ main ()
     }
   if (bar () != 592.0f)
     abort ();
-  s = -__builtin_inff ();
+  s = FLT_MIN_VALUE;
   for (int i = 0; i < 1024; ++i)
     {
       if (b[i] != s)