On vxworks, isunordered is defined as a macro that ultimately calls a
_Fpcomp function, that GCC doesn't recognize as a builtin, so it
can't optimize accordingly.
Use __builtin_isunordered instead to get the desired code for the
test.
for gcc/testsuite/ChangeLog
* gcc.target/aarch64/sve/pred-not-gen-4.c: Drop math.h
include, call builtin.
/* { dg-do compile } */
/* { dg-options "-O3" } */
-#include <math.h>
-
void f13(double * restrict z, double * restrict w, double * restrict x, double * restrict y, int n)
{
for (int i = 0; i < n; i++) {
- z[i] = (isunordered(w[i], 0)) ? x[i] + w[i] : y[i] - w[i];
+ z[i] = (__builtin_isunordered(w[i], 0)) ? x[i] + w[i] : y[i] - w[i];
}
}