]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Work around ICC issue with __builtin_expect in constexpr function 7134/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 31 Aug 2018 09:35:34 +0000 (11:35 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 31 Aug 2018 09:35:34 +0000 (11:35 +0200)
include/deal.II/base/utilities.h

index 03ee0fbfbd9a84b3618891042b5c5dcfab852440..491796bd182b93273b7f24c9e2448309a43c60e6 100644 (file)
@@ -354,7 +354,19 @@ namespace Utilities
   pow(const unsigned int base, const int iexp)
   {
 #ifdef DEAL_II_WITH_CXX14
+#  if defined(DEAL_II_HAVE_BUILTIN_EXPECT) && defined(__INTEL_COMPILER)
+    if (!(iexp >= 0))
+      ::dealii::deal_II_exceptions::internals::issue_error_noreturn(
+        ::dealii::deal_II_exceptions::internals::abort_or_throw_on_exception,
+        __FILE__,
+        __LINE__,
+        __PRETTY_FUNCTION__,
+        "iexp>=0",
+        "ExcMessage(\"The exponent must not be negative!\")",
+        ExcMessage("The exponent must not be negative!"));
+#  else
     Assert(iexp >= 0, ExcMessage("The exponent must not be negative!"));
+#  endif
 #endif
     // The "exponentiation by squaring" algorithm used below has to be
     // compressed to one statement due to C++11's restrictions on constexpr

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.