Patchwork C++ PATCH for c++/49813 (__builtin_isinf in constant expression)

login
register
mail settings
Submitter Paolo Carlini
Date Aug. 1, 2011, 7:28 p.m.
Message ID <4E36FE62.1040807@oracle.com>
Download mbox | patch
Permalink /patch/107796/
State New
Headers show

Comments

Paolo Carlini - Aug. 1, 2011, 7:28 p.m.
Thanks a lot, Jason.

I applied the below, tested x86_64-linux multilib.

Paolo.

//////////////////////
2011-08-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/49813
	* include/c_global/cmath (isinf): Remove workaround.

Patch

Index: include/c_global/cmath
===================================================================
--- include/c_global/cmath	(revision 177068)
+++ include/c_global/cmath	(working copy)
@@ -547,18 +547,17 @@ 
     isfinite(_Tp __x)
     { return true; }
 
-  // Workaround the isinf issue discussed in PR 49813.
   constexpr bool
   isinf(float __x)
-  { return fpclassify(__x) == FP_INFINITE; }
+  { return __builtin_isinf(__x); }
 
   constexpr bool
   isinf(double __x)
-  { return fpclassify(__x) == FP_INFINITE; }
+  { return __builtin_isinf(__x); }
 
   constexpr bool
   isinf(long double __x)
-  { return fpclassify(__x) == FP_INFINITE; }
+  { return __builtin_isinf(__x); }
 
   template<typename _Tp>
     constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,