https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94083
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jsm28 at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Shall __builtin_isinf (x) or __builtin_isinf_sign (x) raise exception if x is a sNaN? Or never? Or it can but doesn't have to? glibc's int64_t hx,lx; GET_LDOUBLE_WORDS64(hx,lx,x); lx |= (hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL; lx |= -lx; return ~(lx >> 63) & (hx >> 62); doesn't, but I think when we lower __builtin_isinf to fabs (x) (which should just clear the sign bit, not raise exception) u<= <max_representable_finite>, it would. If we wouldn't need to raise exception, I think fastest would be to pattern recognize the fabs (x) <= <max_representable> and emit there the (lx | ((hx & 0x7fffffffffffffffLL) ^ 0x7fff000000000000LL)) != 0. But __builtin_islessequal (__builtin_fabsf128 (x), __builtin_nextafterf128 (__builtin_inff128 (), 0.0f128)) I think should raise exception and those 2 will be indistinguishable, so maybe just recognize that case during expansion if 2 libcalls would be needed and emit the equality comparison instead. Or do both depending on if -fsignaling-nans is specified or not?