diff --git a/src/mapleall/maple_be/include/cg/aarch64/aarch64_phases.def b/src/mapleall/maple_be/include/cg/aarch64/aarch64_phases.def index 5243ce26bb5c101322e85946d296a781ec114fd1..a3a74d7b2fba78318e5d5cec8bc2673a531035e7 100644 --- a/src/mapleall/maple_be/include/cg/aarch64/aarch64_phases.def +++ b/src/mapleall/maple_be/include/cg/aarch64/aarch64_phases.def @@ -63,7 +63,7 @@ ADDTARGETPHASE("postcfgo", CGOptions::DoCFGO()); ADDTARGETPHASE("cgpostpeephole", CGOptions::DoPeephole()) ADDTARGETPHASE("peephole", CGOptions::DoPeephole()) - ADDTARGETPHASE("gencfi", !GetMIRModule()->IsCModule()); + ADDTARGETPHASE("gencfi", !GetMIRModule()->IsCModule() || GetMIRModule()->IsWithDbgInfo()); ADDTARGETPHASE("yieldpoint", GetMIRModule()->IsJavaModule() && CGOptions::IsInsertYieldPoint()); ADDTARGETPHASE("scheduling", CGOptions::DoSchedule()); ADDTARGETPHASE("alignanalysis", GetMIRModule()->IsCModule() && CGOptions::DoAlignAnalysis()); diff --git a/src/mapleall/maple_be/include/cg/cgfunc.h b/src/mapleall/maple_be/include/cg/cgfunc.h index f99eafc57b0f1b3db10c1681582642d4dcbb2720..9c6d229b249bcef82d2a70acdf1799d74049cebd 100644 --- a/src/mapleall/maple_be/include/cg/cgfunc.h +++ b/src/mapleall/maple_be/include/cg/cgfunc.h @@ -1075,7 +1075,7 @@ class CGFunc { virtual InsnVisitor *NewInsnModifier() = 0; bool GenCfi() const { - return (mirModule.GetSrcLang() != kSrcLangC); + return (mirModule.GetSrcLang() != kSrcLangC) || mirModule.IsWithDbgInfo(); } MapleVector &GetDbgCallFrameLocations() { diff --git a/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp b/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp index 59e44f6e28366eae54c7768baa466529f8dbbee5..ed5d9a0507d3176151f7e806db06396e4167ca0c 100644 --- a/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp +++ b/src/mapleall/maple_be/src/cg/aarch64/aarch64_proepilog.cpp @@ -1943,7 +1943,7 @@ void AArch64GenProEpilog::ConvertToTailCalls(std::set &callInsnsMap) { CHECK_FATAL(0, "Tailcall in incorrect block"); } FOR_BB_INSNS_SAFE(insn, fromBB, next) { - if (insn->IsMachineInstruction() && insn->GetMachineOpcode() != MOP_xret) { + if (insn->IsCfiInsn() || (insn->IsMachineInstruction() && insn->GetMachineOpcode() != MOP_xret)) { Insn *newInsn = cgFunc.GetTheCFG()->CloneInsn(*insn); newInsn->SetDoNotRemove(true); toBB->InsertInsnBefore(*callInsn, *newInsn);