diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 2ce8eba..a465144 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -7096,6 +7096,7 @@ void InterCodeProcedure::Close(void) bool eliminated; + int retries = 2; // // Now forward constant values // @@ -7119,7 +7120,12 @@ void InterCodeProcedure::Close(void) mEntryBlock->CollectEntries(); */ } - } while (eliminated); + + mTemporaries.SetSize(numTemps, true); + TempForwarding(); + retries--; + + } while (eliminated || retries > 0); DisassembleDebug("value forwarding"); diff --git a/oscar64/NativeCodeGenerator.cpp b/oscar64/NativeCodeGenerator.cpp index b6995bd..274840a 100644 --- a/oscar64/NativeCodeGenerator.cpp +++ b/oscar64/NativeCodeGenerator.cpp @@ -9355,6 +9355,12 @@ bool NativeCodeBasicBlock::PatchDirectAddressSumY(int at, int reg, int apos, int if (last == mIns.Size()) return false; + if (mIns[last].mLive & LIVE_CPU_REG_Y) + { + mIns.Insert(last + 1, NativeCodeInstruction(ASMIT_LDY, ASMIM_IMMEDIATE, yindex)); + mIns[last + 1].mLive |= CPU_REG_Y; + } + mIns[apos].mType = ASMIT_TAY; for (int i = 0; i < 5; i++) {