diff --git a/src/mapleall/maple_be/src/be/lower.cpp b/src/mapleall/maple_be/src/be/lower.cpp index 7baa23320301e481ba2b47e5bf1b89cf4b62cfee..d02bca05e42f0a0d54bccb1152e38cdf6116a1d4 100644 --- a/src/mapleall/maple_be/src/be/lower.cpp +++ b/src/mapleall/maple_be/src/be/lower.cpp @@ -1068,7 +1068,12 @@ void CGLowerer::LowerAsmStmt(AsmNode *asmNode, BlockNode *newBlk) { continue; } // introduce a temporary to store the expression tree operand - MIRSymbol *st = mirModule.GetMIRBuilder()->CreateSymbol((TyIdx)opnd->GetPrimType(), NewAsmTempStrIdx(), + TyIdx tyIdxUsed = (TyIdx)opnd->GetPrimType(); + if (opnd->op == OP_iread) { + IreadNode *ireadNode = static_cast(opnd); + tyIdxUsed = ireadNode->GetType()->GetTypeIndex(); + } + MIRSymbol *st = mirModule.GetMIRBuilder()->CreateSymbol(tyIdxUsed, NewAsmTempStrIdx(), kStVar, kScAuto, mirModule.CurFunction(), kScopeLocal); DassignNode *dass = mirModule.GetMIRBuilder()->CreateStmtDassign(*st, 0, opnd); diff --git a/src/mapleall/maple_me/src/me_ssa_lpre.cpp b/src/mapleall/maple_me/src/me_ssa_lpre.cpp index 4fb6e013d433aef8fbcd45017888857ced0f7b91..e61384169b8e6dd46e5350fb794da206e1a54d3b 100644 --- a/src/mapleall/maple_me/src/me_ssa_lpre.cpp +++ b/src/mapleall/maple_me/src/me_ssa_lpre.cpp @@ -100,8 +100,12 @@ void MeSSALPre::GenerateSaveRealOcc(MeRealOcc &realOcc) { MapleVector::iterator it = mustDefList->begin(); for (; it != mustDefList->end(); it++) { MustDefMeNode *mustDefMeNode = &(*it); + VarMeExpr *theLHS = static_cast(mustDefMeNode->GetLHS()); + // check that this var is the worklist item being worked on + if (static_cast(workCand->GetTheMeExpr())->GetOst() != theLHS->GetOst()) { + continue; + } if (regOrVar->GetMeOp() == kMeOpReg) { - auto *theLHS = static_cast(mustDefMeNode->GetLHS()); // change mustDef lhs to regOrVar mustDefMeNode->UpdateLHS(*regOrVar); EnterCandsForSSAUpdate(regOrVar->GetOstIdx(), *realOcc.GetMeStmt()->GetBB());