diff --git a/src/base/SMPInstr.cpp b/src/base/SMPInstr.cpp index 85da09458fea25c725738c2599ea23043eb7a1e3..e248d7b1a93cb05a374f9b5f34ede2962147eee3 100644 --- a/src/base/SMPInstr.cpp +++ b/src/base/SMPInstr.cpp @@ -10568,6 +10568,8 @@ void SMPInstr::EmitTypeAnnotations(bool UseFP, bool AllocSeen, bool NeedsFrame, #else bool CallInst = ((CALL == DataFlowType) || this->IsTailCall() || this->IsCondTailCall()); #endif + bool IndirJumpInst = (INDIR_JUMP == DataFlowType); + bool IndirJumpAnalyzed = IndirJumpInst && (!this->GetBlock()->GetFunc()->HasUnresolvedIndirectJumps()); bool NumericDEFs = this->AllDefsNumeric(); // all DEFs are NUMERIC or CODEPTR bool ProfiledDEFs = this->AnyDefsProfiled(); // Some DEFs come from the profiler bool UnusedMetadata = this->AllDefMetadataUnused(); @@ -10897,7 +10899,7 @@ void SMPInstr::EmitTypeAnnotations(bool UseFP, bool AllocSeen, bool NeedsFrame, // in telling mmStrata about these constants. // Likewise, we can tell mmStrata if a MemDest is an // non-directly-accessed child object. - if (SDTInstrumentation || NoWarnFlag || CallInst) { + if (SDTInstrumentation || NoWarnFlag || CallInst || IndirJumpAnalyzed) { if (this->DeadRegsBitmap.any()) { // Optimize by informing mmStrata of dead registers. It can avoid saving // and restoring dead state. This is particularly important for EFLAGS, @@ -10906,6 +10908,14 @@ void SMPInstr::EmitTypeAnnotations(bool UseFP, bool AllocSeen, bool NeedsFrame, (unsigned long) addr, this->GetSize()); this->PrintDeadRegs(AnnotFile); SMP_fprintf(AnnotFile, " %s \n", disasm); + if (IndirJumpAnalyzed && (!this->DeadRegsBitmap[MD_FLAGS_REG])) { + // Unusual case: Switch table has live flags into cases. + SMP_msg("INFO: IndirJump at %x has live flags register: Successor blocks: ", this->GetAddr()); + for (list<SMPBasicBlock *>::iterator SuccIter = this->GetBlock()->GetFirstSucc(); SuccIter != this->GetBlock()->GetLastSucc(); ++SuccIter) { + SMP_msg("%x ", (*SuccIter)->GetFirstAddr()); + } + SMP_msg("\n"); + } } int ChildOffset, ChildSize; if (MemDest && ProfInfo->GetMemoryAccessInfo()->ComputeNonDirectAccessRegion(addr,