Fix optimizer crash with volatile long ops
This commit is contained in:
parent
90e892dfa5
commit
242d7f1700
|
@ -5935,12 +5935,12 @@ void InterCodeBasicBlock::Append(InterInstruction * code)
|
|||
}
|
||||
|
||||
|
||||
void InterCodeBasicBlock::AppendBeforeBranch(InterInstruction* code)
|
||||
void InterCodeBasicBlock::AppendBeforeBranch(InterInstruction* code, bool loopindex)
|
||||
{
|
||||
int ti = mInstructions.Size() - 1;
|
||||
if (mInstructions[ti]->mCode == IC_BRANCH)
|
||||
{
|
||||
if (ti > 0 && mInstructions[ti - 1]->mDst.mTemp == mInstructions[ti]->mSrc[0].mTemp && CanBypassUp(code, mInstructions[ti - 1]))
|
||||
if (ti > 0 && mInstructions[ti - 1]->mDst.mTemp == mInstructions[ti]->mSrc[0].mTemp && loopindex || CanBypassUp(code, mInstructions[ti - 1]))
|
||||
{
|
||||
ti--;
|
||||
if (ti > 0 && mInstructions[ti]->UsesTemp(mInstructions[ti - 1]->mDst.mTemp) && CanBypassUp(code, mInstructions[ti - 1]))
|
||||
|
@ -16014,7 +16014,7 @@ bool InterCodeBasicBlock::SingleTailLoopOptimization(const NumberSet& aliasedPar
|
|||
ains->mSrc[0].mType = lins->mDst.mType;
|
||||
ains->mSrc[0].mTemp = -1;
|
||||
ains->mSrc[0].mIntConst = s;
|
||||
tail->AppendBeforeBranch(ains);
|
||||
tail->AppendBeforeBranch(ains, true);
|
||||
ains->mDst.mRange.AddConstValue(ains->mDst.mType, s);
|
||||
|
||||
indexScale[ains->mDst.mTemp] = s;
|
||||
|
@ -23433,7 +23433,7 @@ void InterCodeProcedure::Close(void)
|
|||
{
|
||||
GrowingTypeArray tstack(IT_NONE);
|
||||
|
||||
CheckFunc = !strcmp(mIdent->mString, "shipyard_close");
|
||||
CheckFunc = !strcmp(mIdent->mString, "close_op");
|
||||
CheckCase = false;
|
||||
|
||||
mEntryBlock = mBlocks[0];
|
||||
|
|
|
@ -423,7 +423,7 @@ public:
|
|||
InterCodeBasicBlock* Clone(void);
|
||||
|
||||
void Append(InterInstruction * code);
|
||||
void AppendBeforeBranch(InterInstruction* code);
|
||||
void AppendBeforeBranch(InterInstruction* code, bool loopindex = false);
|
||||
const InterInstruction* FindByDst(int dst) const;
|
||||
void Close(InterCodeBasicBlock* trueJump, InterCodeBasicBlock* falseJump);
|
||||
|
||||
|
|
|
@ -19444,7 +19444,7 @@ bool NativeCodeBasicBlock::MoveStoresBeforeDiamond(void)
|
|||
eblock = mTrueJump;
|
||||
}
|
||||
|
||||
if (eblock)
|
||||
if (eblock && eblock->mEntryRequiredRegs.Size() > 0)
|
||||
{
|
||||
bool avalid = eblock->mEntryRequiredRegs[CPU_REG_A] && !dblock->ChangesAccu();
|
||||
bool xvalid = eblock->mEntryRequiredRegs[CPU_REG_X] && !dblock->ChangesXReg();
|
||||
|
@ -53745,7 +53745,7 @@ void NativeCodeProcedure::Compile(InterCodeProcedure* proc)
|
|||
{
|
||||
NativeCodeBasicBlock* eblock = mExitBlock->mEntryBlocks[0];
|
||||
int sz = eblock->mIns.Size();
|
||||
if (sz >= 0 && eblock->mIns[sz - 1].mType == ASMIT_STA && eblock->mIns[sz - 1].mMode == ASMIM_ZERO_PAGE && eblock->mIns[sz - 1].mAddress == BC_REG_ACCU)
|
||||
if (sz > 0 && eblock->mIns[sz - 1].mType == ASMIT_STA && eblock->mIns[sz - 1].mMode == ASMIM_ZERO_PAGE && eblock->mIns[sz - 1].mAddress == BC_REG_ACCU)
|
||||
{
|
||||
mExitBlock->mExitRegA = true;
|
||||
eblock->mIns.Remove(sz - 1);
|
||||
|
|
Loading…
Reference in New Issue