diff --git a/oscar64/GlobalOptimizer.cpp b/oscar64/GlobalOptimizer.cpp index fa42e83..519c5d1 100644 --- a/oscar64/GlobalOptimizer.cpp +++ b/oscar64/GlobalOptimizer.cpp @@ -267,12 +267,14 @@ bool GlobalOptimizer::ReplaceGlobalConst(Expression* exp) if (exp->mType == EX_VARIABLE && (exp->mDecValue->mFlags & (DTF_GLOBAL | DTF_STATIC)) && !(exp->mDecValue->mOptFlags & (OPTF_VAR_MODIFIED | OPTF_VAR_ADDRESS)) && exp->mDecValue->mValue) { Expression* cexp = exp->mDecValue->mValue; - if (cexp->mType == EX_CONSTANT) + if (cexp->mType == EX_CONSTANT && + (cexp->mDecValue->mType == DT_CONST_ADDRESS || cexp->mDecValue->mType == DT_CONST_INTEGER || + cexp->mDecValue->mType == DT_CONST_POINTER || cexp->mDecValue->mType == DT_CONST_FLOAT)) { exp->mType = EX_CONSTANT; exp->mDecValue = cexp->mDecValue; + changed = true; } - changed = true; } if (ReplaceGlobalConst(exp->mLeft)) diff --git a/oscar64/InterCode.cpp b/oscar64/InterCode.cpp index 2313e52..e56043a 100644 --- a/oscar64/InterCode.cpp +++ b/oscar64/InterCode.cpp @@ -4202,12 +4202,7 @@ bool InterInstruction::PropagateConstTemps(const GrowingInstructionPtrArray& cte { InterInstruction* ains = ctemps[mSrc[0].mTemp]; mCode = IC_CONSTANT; - mConst.mIntConst = ains->mConst.mIntConst; - mConst.mFloatConst = ains->mConst.mFloatConst; - mConst.mLinkerObject = ains->mConst.mLinkerObject; - mConst.mVarIndex = ains->mConst.mVarIndex; - mConst.mMemory = ains->mConst.mMemory; - mConst.mType = ains->mConst.mType; + mConst = ains->mConst; mSrc[0].mTemp = -1; mNumOperands = 0; return true; @@ -22243,7 +22238,7 @@ void InterCodeProcedure::Close(void) { GrowingTypeArray tstack(IT_NONE); - CheckFunc = !strcmp(mIdent->mString, "main"); + CheckFunc = !strcmp(mIdent->mString, "intro_display"); CheckCase = false; mEntryBlock = mBlocks[0];