// it up to date for vars that are not register candidates
// (it would be nice to have a xor set function)
- VARSET_TP extraLiveVars(VarSetOps::Diff(compiler, block->bbLiveOut, compiler->compCurLife));
- VarSetOps::UnionD(compiler, extraLiveVars, VarSetOps::Diff(compiler, compiler->compCurLife, block->bbLiveOut));
- VarSetOps::Iter extraLiveVarIter(compiler, extraLiveVars);
- unsigned extraLiveVarIndex = 0;
- while (extraLiveVarIter.NextElem(&extraLiveVarIndex))
- {
- unsigned varNum = compiler->lvaTrackedToVarNum[extraLiveVarIndex];
+ VARSET_TP mismatchLiveVars(VarSetOps::Diff(compiler, block->bbLiveOut, compiler->compCurLife));
+ VarSetOps::UnionD(compiler, mismatchLiveVars,
+ VarSetOps::Diff(compiler, compiler->compCurLife, block->bbLiveOut));
+ VarSetOps::Iter mismatchLiveVarIter(compiler, mismatchLiveVars);
+ unsigned mismatchLiveVarIndex = 0;
+ bool foundMismatchedRegVar = false;
+ while (mismatchLiveVarIter.NextElem(&mismatchLiveVarIndex))
+ {
+ unsigned varNum = compiler->lvaTrackedToVarNum[mismatchLiveVarIndex];
LclVarDsc* varDsc = compiler->lvaTable + varNum;
- assert(!varDsc->lvIsRegCandidate());
+ if (varDsc->lvIsRegCandidate())
+ {
+ if (!foundMismatchedRegVar)
+ {
+ JITDUMP("Mismatched live reg vars after BB%02u:", block->bbNum);
+ foundMismatchedRegVar = true;
+ }
+ JITDUMP(" V%02u", varNum);
+ }
+ }
+ if (foundMismatchedRegVar)
+ {
+ assert(!"Found mismatched live reg var(s) after block");
+ JITDUMP("\n");
}
#endif