From 056063462ef68b884463f80e1ca5b4652cf78ee5 Mon Sep 17 00:00:00 2001 From: clc5q <clc5q@git.zephyr-software.com> Date: Sat, 16 Jan 2016 22:39:14 +0000 Subject: [PATCH] Safeguard to avoid STARS IRDB assertion failures. Former-commit-id: 9184a03fe9547df82eb5c4e069eeca5076f035b3 --- src/base/SMPFunction.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/base/SMPFunction.cpp b/src/base/SMPFunction.cpp index 7d23579a..3ebaaa8d 100644 --- a/src/base/SMPFunction.cpp +++ b/src/base/SMPFunction.cpp @@ -4612,6 +4612,11 @@ bool SMPFunction::PropagateGlobalMetadata(const STARSOpndTypePtr &UseOp, SMPMeta return changed; } + if (STARS_LIVEIN_PSEUDO_ID == DefAddr) { + // Seems to only happen on STARS/IRDB. Need to debug later. !!!!****!!!! + return changed; + } + if (!STARS_IsBlockNumPseudoID(DefAddr)) { // found a DEF inst. SMPInstr *CurrInst = this->GetInstFromAddr(DefAddr); STARS_ea_t InstAddr = DefAddr; @@ -9168,6 +9173,7 @@ bool SMPFunction::FindShadowingPoint(const STARS_ea_t ShadowCheckAddr, const STA this->RemoveLocalRefs(SearchSet); CurrBlock = this->RPOBlocks[(size_t) BlockIndex]; + bool UnsafeMemWriteSeen = false; for (InstIter = CurrBlock->GetRevInstCBegin(); InstIter != CurrBlock->GetRevInstCEnd(); ++InstIter) { SMPInstr *CurrInst = (*InstIter); STARS_ea_t InstAddr = CurrInst->GetAddr(); @@ -9183,11 +9189,14 @@ bool SMPFunction::FindShadowingPoint(const STARS_ea_t ShadowCheckAddr, const STA pair<STARSDefUseIter, bool> InsertResult = SearchSet.insert(*UseIter); // might not be new insert; USE can be copied into 2 DEFs ShadowAddr = InstAddr; // highest copy addr seen so far ShadowOp = UseOp; // highest copy source seen so far - if (DefIter->HasIndirectWrite()) { + if (UnsafeMemWriteSeen || DefIter->HasIndirectWrite()) { UnsafeChain = true; } } } + if (!UnsafeMemWriteSeen && CurrInst->HasIndirectMemoryWrite()) { + UnsafeMemWriteSeen = true; + } } // end for all insts in block, reverse iteration } // end for all blocks prior to CriticalOp block, RPO descending order } -- GitLab