This assertion requires that we have an exact number of
remember/restore CFIs. That is unnecessarily strict. We should only
assert that we have more remember instructions than restore ones.
Fixes #61721
Paths
| Differential D147029
Remove assertion on CFI stack DraftPublic Authored by rafauler on Mar 27 2023, 11:41 PM. This is a draft revision that has not yet been submitted for review.
Details
Diff Detail
Event Timeline
Comment Actions Hi, any progress on this patch? Those who try to bolt a program built by clang in AArch64 are likely encounters this unnecessary assertion failure.
void AsmPrinter::emitCFIInstruction(const MachineInstr &MI) { ... ... // If there is no "real" instruction following this CFI instruction, skip // emitting it; it would be beyond the end of the function's FDE range. auto *MBB = MI.getParent(); auto I = std::next(MI.getIterator()); while (I != MBB->end() && I->isTransient()) ++I; if (I == MBB->instr_end() && MBB->getReverseIterator() == MBB->getParent()->rbegin()) return; #61971 is another issue encountered this problem.
Revision Contents
Diff 508904 bolt/lib/Core/BinaryFunction.cpp
bolt/test/AArch64/Inputs/unbalanced_cfi.s
bolt/test/AArch64/unbalanced_cfi.test
|
Just wondering - we are not interested in operation types that might be in state stack? E.g. are we only expect to have OpRestoreState here or any kind?