Index: lib/Analysis/ScalarEvolutionExpander.cpp =================================================================== --- lib/Analysis/ScalarEvolutionExpander.cpp +++ lib/Analysis/ScalarEvolutionExpander.cpp @@ -1746,7 +1746,8 @@ if (I != InsertedExpressions.end()) return I->second; - assert(isSafeToExpand(S, SE) && "Attempt to expand something unsafe!"); + assert(isSafeToExpandAt(S, InsertPt, SE) && + "Attempt to expand something unsafe at the specified point!"); SCEVInsertPointGuard Guard(Builder, this); Builder.SetInsertPoint(InsertPt);