From: wolf Date: Wed, 17 Jul 2002 09:32:03 +0000 (+0000) Subject: Check for a bug on sparc with long doubles and optimization. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=daa68d58c9c6b28e86ff661104fa1b567f6c9c75;p=dealii-svn.git Check for a bug on sparc with long doubles and optimization. git-svn-id: https://svn.dealii.org/trunk@6251 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/aclocal.m4 b/deal.II/aclocal.m4 index 2201b1c44f..d3fa6c422b 100644 --- a/deal.II/aclocal.m4 +++ b/deal.II/aclocal.m4 @@ -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 diff --git a/deal.II/configure.in b/deal.II/configure.in index a4fe487c6f..aec5e80e9d 100644 --- a/deal.II/configure.in +++ b/deal.II/configure.in @@ -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