diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 45328ec..2319efe 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -13642,7 +13642,7 @@ void InterCodeBasicBlock::FollowJumps(void) { InterCodeBasicBlock* block = mTrueJump->Clone(); block->mInstructions[1]->mCode = IC_JUMP; - block->mInstructions[1]->mNumOperands = 1; + block->mInstructions[1]->mNumOperands = 0; block->Close(mTrueJump->mTrueJump, nullptr); block->mTrueJump->mNumEntries++; @@ -13660,7 +13660,7 @@ void InterCodeBasicBlock::FollowJumps(void) { InterCodeBasicBlock* block = mFalseJump->Clone(); block->mInstructions[1]->mCode = IC_JUMP; - block->mInstructions[1]->mNumOperands = 1; + block->mInstructions[1]->mNumOperands = 0; block->Close(mFalseJump->mFalseJump, nullptr); block->mTrueJump->mNumEntries++; @@ -16301,7 +16301,7 @@ bool InterCodeBasicBlock::PostDecLoopOptimization(void) { InterInstruction* ins = mInstructions[inci]; - int v = ins->mSrc[inco].mIntConst; + int64 v = ins->mSrc[inco].mIntConst; if (ins->mDst.mRange.mMaxState == IntegerValueRange::S_BOUND) ins->mDst.mRange.mMaxValue -= v; diff --git a/oscar64/NativeCodeGenerator.cpp b/oscar64/NativeCodeGenerator.cpp index 42da5ea..66896df 100644 --- a/oscar64/NativeCodeGenerator.cpp +++ b/oscar64/NativeCodeGenerator.cpp @@ -40591,6 +40591,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mAddress = (mIns[i + 0].mAddress - 1) & 255; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if ( @@ -40599,6 +40600,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mAddress = (mIns[i + 0].mAddress + 1) & 255; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if ( @@ -40607,6 +40609,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mAddress = (mIns[i + 0].mAddress - 1) & 255; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if ( @@ -40615,6 +40618,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mAddress = (mIns[i + 0].mAddress + 1) & 255; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } @@ -40624,6 +40628,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mType = ASMIT_LDY; mIns[i + 0].mLive |= mIns[i + 1].mLive; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if ( @@ -40632,6 +40637,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mType = ASMIT_LDX; mIns[i + 0].mLive |= mIns[i + 1].mLive; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if ( @@ -40640,6 +40646,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mType = ASMIT_LDA; mIns[i + 0].mLive |= mIns[i + 1].mLive; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if ( @@ -40648,6 +40655,7 @@ bool NativeCodeBasicBlock::PeepHoleOptimizer(NativeCodeProcedure* proc, int pass { mIns[i + 0].mType = ASMIT_LDA; mIns[i + 0].mLive |= mIns[i + 1].mLive; mIns[i + 1].mType = ASMIT_NOP; mIns[i + 1].mMode = ASMIM_IMPLIED; + mIns[i + 0].mLive |= mIns[i + 1].mLive; progress = true; } else if (