[llvm] r245466 - [SCEV] Fix GCC 4.8.0 ICE in lambda function

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 10:26:07 PDT 2015


Author: hfinkel
Date: Wed Aug 19 12:26:07 2015
New Revision: 245466

URL: http://llvm.org/viewvc/llvm-project?rev=245466&view=rev
Log:
[SCEV] Fix GCC 4.8.0 ICE in lambda function

Rewrite some code to not use a lambda function. The non-lambda code is just
about as clean as the original, and not any longer. The lambda function causes
an internal compiler error in GCC 4.8.0, and it is not worth breaking support
for that compiler over this. NFC.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=245466&r1=245465&r2=245466&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Aug 19 12:26:07 2015
@@ -7351,13 +7351,9 @@ static bool IsKnownPredicateViaAddRecSta
   if (LAR->getStepRecurrence(SE) != RAR->getStepRecurrence(SE))
     return false;
 
-  auto CheckWrap = [Pred](const SCEVAddRecExpr *AR) -> bool {
-    if (ICmpInst::isSigned(Pred))
-      return AR->getNoWrapFlags(SCEV::FlagNSW);
-    return AR->getNoWrapFlags(SCEV::FlagNUW);
-  };
-
-  if (!CheckWrap(LAR) || !CheckWrap(RAR))
+  SCEV::NoWrapFlags NW = ICmpInst::isSigned(Pred) ?
+                         SCEV::FlagNSW : SCEV::FlagNUW;
+  if (!LAR->getNoWrapFlags(NW) || !RAR->getNoWrapFlags(NW))
     return false;
 
   return SE.isKnownPredicate(Pred, LAR->getStart(), RAR->getStart());




More information about the llvm-commits mailing list