diff --git a/include/opp/boundint.h b/include/opp/boundint.h index d6076a5..4f9f5bd 100644 --- a/include/opp/boundint.h +++ b/include/opp/boundint.h @@ -32,6 +32,13 @@ namespace opp { v = k; } + void operator+=(int k) + { + k += v; + __assume(k >= tmin && k <= tmax); + v = k; + } + operator int() const { int k = v; diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index f9836b3..d0d3230 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -8775,7 +8775,7 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSetsForward(const GrowingVariab { vr.mMinState = IntegerValueRange::S_BOUND; vr.mMinValue = 0; - vr.LimitMax(ins->mSrc[0].mIntConst); + vr.LimitMax(ins->mSrc[0].mIntConst & BuildLowerBitsMask(ins->mSrc[1].mRange.mMaxValue)); } else { @@ -8794,7 +8794,7 @@ void InterCodeBasicBlock::UpdateLocalIntegerRangeSetsForward(const GrowingVariab { vr.mMinState = IntegerValueRange::S_BOUND; vr.mMinValue = 0; - vr.LimitMax(ins->mSrc[1].mIntConst); + vr.LimitMax(ins->mSrc[1].mIntConst & BuildLowerBitsMask(ins->mSrc[0].mRange.mMaxValue)); } else {