diff --git a/src/mapleall/maple_me/src/alias_class.cpp b/src/mapleall/maple_me/src/alias_class.cpp index f1680822efe130b01dda418b39d750d202fe456d..1fe468b8e9ac2c97d592fc23510139b775636304 100644 --- a/src/mapleall/maple_me/src/alias_class.cpp +++ b/src/mapleall/maple_me/src/alias_class.cpp @@ -379,7 +379,7 @@ AliasInfo AliasClass::CreateAliasElemsExpr(BaseNode &expr) { } else { ASSERT(expr.GetOpCode() == OP_add, "Wrong operation!"); } - OffsetType newOffset = aliasInfo.offset + constVal * bitsPerByte; + OffsetType newOffset = aliasInfo.offset + static_cast(constVal) * static_cast(bitsPerByte); return AliasInfo(aliasInfo.ae, 0, newOffset); } case OP_array: { diff --git a/src/mapleall/maple_me/src/me_ivopts.cpp b/src/mapleall/maple_me/src/me_ivopts.cpp index 70e21b36db1e331501f81b246d87bb1840794ada..8b72fceb32f6f08bda24cfa11360cbc016b9f61c 100644 --- a/src/mapleall/maple_me/src/me_ivopts.cpp +++ b/src/mapleall/maple_me/src/me_ivopts.cpp @@ -1456,7 +1456,7 @@ MeExpr *IVOptimizer::ComputeExtraExprOfBase(MeExpr &candBase, MeExpr &groupBase, for (auto &itCand : candMap) { auto itGroup = groupMap.find(itCand.first); if (itCand.first == kInvalidExprID) { - candConst = static_cast(itCand.second.second * ratio); + candConst = static_cast(itCand.second.second) * static_cast(ratio); groupConst = itGroup == groupMap.end() ? 0 : itGroup->second.second; continue; } diff --git a/src/mapleall/maple_me/src/me_value_range_prop.cpp b/src/mapleall/maple_me/src/me_value_range_prop.cpp index 8234be1e63b6fb4fefcc58a7ec29e06648424618..816d0fbe871608396a12e91f68bbace1a8d2d398 100755 --- a/src/mapleall/maple_me/src/me_value_range_prop.cpp +++ b/src/mapleall/maple_me/src/me_value_range_prop.cpp @@ -1653,7 +1653,11 @@ bool ValueRangePropagation::AddOrSubWithConstant( overflowOrUnderflow = OverflowOrUnderflow(primType, lhsConstant, rhsConstant); } else { CHECK_FATAL(op == OP_sub, "must be sub"); - overflowOrUnderflow = OverflowOrUnderflow(primType, lhsConstant, -rhsConstant); + if (rhsConstant == GetMinNumber(primType)) { + overflowOrUnderflow = true; + } else { + overflowOrUnderflow = OverflowOrUnderflow(primType, lhsConstant, -rhsConstant); + } } if (!overflowOrUnderflow) { res = (op == OP_add) ? (lhsConstant + rhsConstant) : (lhsConstant - rhsConstant);