This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] Small numerics tweaks


Hi,

tested x86-linux, committed.

Paolo.

////////////////
2005-01-26  Paolo Carlini  <pcarlini@suse.de>

	* acinclude.m4 ([GLIBCXX_ENABLE_C99]): Add ac_c99_complex
	to the final test for enable_c99, thus robustifying it; remove
	duplicate final test on ac_99_math.
	* configure: Regenerate.

	* include/std/std_complex.h: Remove usages of the dead
	_GLIBCXX_BUGGY_COMPLEX macro.

	* testsuite/26_numerics/cmath/19322.cc: Protect with
	_GLIBCXX_USE_C99_MATH instead of the stronger _GLIBCXX_USE_C99,
	since only C99 math facilities are involved.
	* testsuite/26_numerics/cmath/c99_classification_macros_c++.cc:
	Likewise.
diff -urN libstdc++-v3-orig/acinclude.m4 libstdc++-v3/acinclude.m4
--- libstdc++-v3-orig/acinclude.m4	2005-01-26 01:27:46.000000000 +0100
+++ libstdc++-v3/acinclude.m4	2005-01-26 01:29:00.000000000 +0100
@@ -871,7 +871,7 @@
     AC_DEFINE(_GLIBCXX_USE_C99_MATH)
   fi
 
-  # Check for the existence of <math.h> complex functions.
+  # Check for the existence of <complex.h> complex functions.
   # This is necessary even though libstdc++ uses the builtin versions
   # of these functions, because if the builtin cannot be used, a reference
   # to the library function is emitted.
@@ -1055,6 +1055,7 @@
 
   AC_MSG_CHECKING([for enabled ISO C99 support])
   if test x"$ac_c99_math" = x"no" ||
+     test x"$ac_c99_complex" = x"no" ||
      test x"$ac_c99_stdio" = x"no" ||
      test x"$ac_c99_stdlib" = x"no" ||
      test x"$ac_c99_wchar" = x"no"; then
@@ -1062,10 +1063,6 @@
   fi;
   AC_MSG_RESULT($enable_c99)
 
-  if test x"$ac_99_math" = x"yes"; then
-    AC_DEFINE(_GLIBCXX_USE_C99_MATH)
-  fi
-
   # Option parsed, now set things appropriately
   if test x"$enable_c99" = x"yes"; then
     AC_DEFINE(_GLIBCXX_USE_C99)
diff -urN libstdc++-v3-orig/include/std/std_complex.h libstdc++-v3/include/std/std_complex.h
--- libstdc++-v3-orig/include/std/std_complex.h	2005-01-25 18:23:11.000000000 +0100
+++ libstdc++-v3/include/std/std_complex.h	2005-01-26 01:29:00.000000000 +0100
@@ -995,9 +995,7 @@
       complex(_ComplexT __z) : _M_value(__z) { }
 
       complex(float = 0.0f, float = 0.0f);
-#if _GLIBCXX_BUGGY_COMPLEX
-      complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+
       explicit complex(const complex<double>&);
       explicit complex(const complex<long double>&);
 
@@ -1150,10 +1148,8 @@
 
       complex(_ComplexT __z) : _M_value(__z) { }
 
-      complex(double  = 0.0, double = 0.0);
-#if _GLIBCXX_BUGGY_COMPLEX
-      complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+      complex(double = 0.0, double = 0.0);
+
       complex(const complex<float>&);
       explicit complex(const complex<long double>&);
 
@@ -1306,9 +1302,7 @@
       complex(_ComplexT __z) : _M_value(__z) { }
 
       complex(long double = 0.0L, long double = 0.0L);
-#if _GLIBCXX_BUGGY_COMPLEX
-      complex(const complex& __z) : _M_value(__z._M_value) { }
-#endif
+
       complex(const complex<float>&);
       complex(const complex<double>&);
 
diff -urN libstdc++-v3-orig/testsuite/26_numerics/cmath/19322.cc libstdc++-v3/testsuite/26_numerics/cmath/19322.cc
--- libstdc++-v3-orig/testsuite/26_numerics/cmath/19322.cc	2005-01-16 10:59:06.000000000 +0100
+++ libstdc++-v3/testsuite/26_numerics/cmath/19322.cc	2005-01-26 01:29:00.000000000 +0100
@@ -28,7 +28,7 @@
 #include <cmath>
 #include <testsuite_hooks.h>
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
 // libstdc++/19322
 void test01()
 {
@@ -40,7 +40,7 @@
 
 int main()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
   test01();
 #endif
   return 0;
diff -urN libstdc++-v3-orig/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc
--- libstdc++-v3-orig/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc	2005-01-13 20:33:40.000000000 +0100
+++ libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc	2005-01-26 01:29:00.000000000 +0100
@@ -55,7 +55,7 @@
 
 void isunordered() { }
 
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
 template <typename _Tp>
   void test_c99_classify()
   {
@@ -83,7 +83,7 @@
 
 int main()
 {
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
   test_c99_classify<float>();
   test_c99_classify<double>();
 #endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]