From: Carol Eidt Date: Wed, 13 Nov 2019 16:00:28 +0000 (-0800) Subject: Fix assert when extending lifetimes (dotnet/coreclr#27839) X-Git-Tag: submit/tizen/20210909.063632~11030^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=644a0b91a5a072b38325589490483296d0f61823;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Fix assert when extending lifetimes (dotnet/coreclr#27839) This assert was added in the prework for EH write-thru. In the case where we're extending lifetimes for stress, we should ignore the locations of these. Note that they aren't reported to codegen anyway. Fix dotnet/coreclr#27804 Commit migrated from https://github.com/dotnet/coreclr/commit/1fd33a734290138da009fbd0682f1f4399172b8f --- diff --git a/src/coreclr/src/jit/lsra.cpp b/src/coreclr/src/jit/lsra.cpp index 17ec59b..e0cb77e 100644 --- a/src/coreclr/src/jit/lsra.cpp +++ b/src/coreclr/src/jit/lsra.cpp @@ -4748,7 +4748,14 @@ void LinearScan::processBlockStartLocations(BasicBlock* currentBlock) // This should still be in its initialized empty state. for (unsigned varIndex = 0; varIndex < compiler->lvaTrackedCount; varIndex++) { - assert(inVarToRegMap[varIndex] == REG_STK); + // In the case where we're extending lifetimes for stress, we are intentionally modeling variables + // as live when they really aren't to create extra register pressure & constraints. + // However, this means that non-EH-vars will be live into EH regions. We can and should ignore the + // locations of these. Note that they aren't reported to codegen anyway. + if (!getLsraExtendLifeTimes() || VarSetOps::IsMember(compiler, currentBlock->bbLiveIn, varIndex)) + { + assert(inVarToRegMap[varIndex] == REG_STK); + } } #endif // DEBUG predVarToRegMap = inVarToRegMap;