https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71869
Bug ID: 71869 Summary: __builtin_isgreater raises an invalid exception on PPC64 using __float128 inputs. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: murphyp at linux dot vnet.ibm.com Target Milestone: --- #include <fenv.h> volatile __float128 qnan = __builtin_nanq(""); int main() { feclearexcept(FE_INVALID); if (__builtin_isgreater(1.0Q, qnan)) puts("isgreater is broken"); if (fetestexcept(FE_INVALID)) puts("invalid wrongly set for quiet comparison"); return 0; } Using a recent gcc-6-branch checkout: gcc -mfloat128 -mcpu=power8 I assume this also the case for the other __builtin_is{ordering} functions too. This causes a substantial number of test failures for float128 when shoehorned into the glibc libm test suite. (Note, this is much hacked up local copy of glibc to verify the compiler support for float128 is sufficient for glibc). x86 appears to stick a call to __unordtf2 before attempting to call the comparison function. I assume PPC64 should be doing a similar for KFmode.