[PATCH] D75755: [AArch64][Fix] LdSt optimization generate premature stack-popping

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 08:35:23 PDT 2020


efriedma added a comment.

The problem on Windows is that every instruction in the prologue/epilogue has an associated unwind opcode, represented as a pseudo-instruction.  If those pseudo-instructions don't match the actual instructions, the offsets will all be wrong, so the unwind info will be corrupt.  In practice, we saw a miscompile involving a call placed immediately after a ret instruction.  The check should look something like https://github.com/llvm/llvm-project/blob/6d026c89dc6a3ba405e6767a3aa0bbb6ba27a0c9/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp#L1998 .

DWARF unwind doesn't work like that, of course.  But you'll still get very weird results if you set a breakpoint in certain places.  I'm pretty sure we have a pseudo-instruction for DWARF stack adjustments?  I forget what that looks like.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75755/new/

https://reviews.llvm.org/D75755





More information about the llvm-commits mailing list