Commit 5d121287 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/91096 (Openmp vector max reduction incorrect)

	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
parent 2dcb0d5b
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> 2019-07-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67184 (again) PR c++/67184 (again)
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
#include "tree-vect.h" #include "tree-vect.h"
#endif #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]; float r = 1.0f, a[1024], b[1024];
__attribute__((noipa)) void __attribute__((noipa)) void
...@@ -24,7 +30,7 @@ foo (float *a, float *b) ...@@ -24,7 +30,7 @@ foo (float *a, float *b)
__attribute__((noipa)) float __attribute__((noipa)) float
bar (void) bar (void)
{ {
float s = -__builtin_inff (); float s = FLT_MIN_VALUE;
#pragma omp simd reduction (inscan, max:s) #pragma omp simd reduction (inscan, max:s)
for (int i = 0; i < 1024; i++) for (int i = 0; i < 1024; i++)
{ {
...@@ -84,7 +90,7 @@ main () ...@@ -84,7 +90,7 @@ main ()
} }
if (bar () != 592.0f) if (bar () != 592.0f)
abort (); abort ();
s = -__builtin_inff (); s = FLT_MIN_VALUE;
for (int i = 0; i < 1024; ++i) for (int i = 0; i < 1024; ++i)
{ {
if (s < a[i]) if (s < a[i])
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
#include "tree-vect.h" #include "tree-vect.h"
#endif #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]; float r = 1.0f, a[1024], b[1024];
__attribute__((noipa)) void __attribute__((noipa)) void
...@@ -24,7 +30,7 @@ foo (float *a, float *b) ...@@ -24,7 +30,7 @@ foo (float *a, float *b)
__attribute__((noipa)) float __attribute__((noipa)) float
bar (void) bar (void)
{ {
float s = -__builtin_inff (); float s = FLT_MIN_VALUE;
#pragma omp simd reduction (inscan, max:s) #pragma omp simd reduction (inscan, max:s)
for (int i = 0; i < 1024; i++) for (int i = 0; i < 1024; i++)
{ {
...@@ -82,7 +88,7 @@ main () ...@@ -82,7 +88,7 @@ main ()
} }
if (bar () != 592.0f) if (bar () != 592.0f)
abort (); abort ();
s = -__builtin_inff (); s = FLT_MIN_VALUE;
for (int i = 0; i < 1024; ++i) for (int i = 0; i < 1024; ++i)
{ {
if (b[i] != s) if (b[i] != s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment