http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49813

--- Comment #48 from Kaveh Ghazi <ghazi at gcc dot gnu.org> 2011-07-27 22:32:57 
UTC ---
(In reply to comment #41)
> The testcase in Comment #30 has the types wrong, the below is a corrected
> version (the substance of the issue doesn't change at all). I'm also thinking
> of checking in the library bits with a temporary workaround of the form:
>   inline constexpr bool
>   isinf(long double __x)
>   { return fpclassify(__x) == FP_INFINITE; }
> which works.
> /////////////
> inline constexpr bool
> isinf(long double __x)
> { return __builtin_isinf(__x); }
> inline constexpr bool
> isinf(double __x)
> { return __builtin_isinf(__x); }
> inline constexpr bool
> isnan(long double __x)
> { return __builtin_isnan(__x); }
> int main()
> {
>   constexpr  int i1 = __builtin_isinf(1.l);  // Ok.
>   constexpr bool b2 = isinf(1.l);            // Error.
>   constexpr bool b3 = isinf(1.);             // Ok.
>   constexpr bool b4 = isnan(1.l);            // Ok.
> }


The isinf (and isinf_sign) functions use the (...) signature, but isinff and
isinfl do not.  So if as noted in comment#42 the problem is with the long
double variant using ellipses by calling isinf(...), perhaps you can fix it by
using __builtin_isinfl (with the trailng "L") in the inline definition.  I'm
not sure why isnan passes, cause that one uses ellipses for the double variant
also.  Probably best to fix all the inlines to use the specific "L" or "F"
function.

Reply via email to