]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check for a bug on sparc with long doubles and optimization.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Jul 2002 09:32:03 +0000 (09:32 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Jul 2002 09:32:03 +0000 (09:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@6251 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure.in

index 2201b1c44fb7e779c970939d871c1d406bd9f9f4..d3fa6c422ba15fc5960802b9d601e00d1a26c3ed 100644 (file)
@@ -2103,6 +2103,56 @@ AC_DEFUN(DEAL_II_CHECK_MEMBER_VAR_SPECIALIZATION_BUG, dnl
 
 
 
+dnl -------------------------------------------------------------
+dnl gcc3.1 (and maybe later compilers) has a bug with long double
+dnl and optimization (see code below), when compiling on Sparc
+dnl machines
+dnl
+dnl Usage: DEAL_II_CHECK_LONG_DOUBLE_LOOP_BUG
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_LONG_DOUBLE_LOOP_BUG, dnl
+[
+  AC_MSG_CHECKING(for long double optimization bug)
+  AC_LANG(C++)
+  CXXFLAGS="$CXXFLAGSO"
+  AC_TRY_COMPILE(
+    [
+       double* copy(long double* first, long double* last, double* result)
+       {
+         int n;
+         for (n = last - first; n > 0; --n) {
+           *result = *first;
+           ++first;
+           ++result;
+         }
+         return result;
+       }
+
+       void f()
+       {
+         long double *p1, *p2;
+         double *p3;
+         copy (p1, p2, p3);
+         p3 = copy (p1, p2, p3);
+       };
+    ],
+    [],
+    [
+      AC_MSG_RESULT(no)
+    ],
+    [
+      AC_MSG_RESULT(yes. disabling respective functions)
+      AC_DEFINE(DEAL_II_LONG_DOUBLE_LOOP_BUG, 1, 
+                     [Defined if the compiler gets an internal compiler
+                      upon some code involving long doubles, and with
+                      optimization. For the details, look at
+                      aclocal.m4 in the top-level directory.])
+    ])
+])
+
+
+
 
 dnl -------------------------------------------------------------
 dnl gcc2.95 doesn't have the std::iterator class, but the standard
index a4fe487c6fc26bf911811b7fd484d13ac10ac7d3..aec5e80e9d358ca9e8a80c3214f2e487b7853fe0 100644 (file)
@@ -165,6 +165,7 @@ DEAL_II_CHECK_IMPLEMENTED_PURE_FUNCTION_BUG
 DEAL_II_CHECK_TEMPLATE_TEMPLATE_TYPEDEF_BUG
 DEAL_II_CHECK_NESTED_CLASS_FRIEND_BUG
 DEAL_II_CHECK_MEMBER_VAR_SPECIALIZATION_BUG
+DEAL_II_CHECK_LONG_DOUBLE_LOOP_BUG
 DEAL_II_HAVE_PRETTY_FUNCTION
 DEAL_II_HAVE_STD_ITERATOR
 DEAL_II_HAVE_STD_STRINGSTREAM

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.