diff --git a/lib/Transforms/Scalar/GCSE.cpp b/lib/Transforms/Scalar/GCSE.cpp index b467784b5e1..6883818dbc0 100644 --- a/lib/Transforms/Scalar/GCSE.cpp +++ b/lib/Transforms/Scalar/GCSE.cpp @@ -120,6 +120,7 @@ bool GCSE::EliminateRedundancies(Instruction *I, // Erase the instruction from the program. I->getParent()->getInstList().erase(I); + WorkList.erase(I); } return true;