[PATCH] D143812: [X86][Win64] Avoid statepoints prior to SEH epilogue

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 00:37:28 PST 2023


mstorsjo added a reviewer: efriedma.
mstorsjo added a subscriber: efriedma.
mstorsjo added a comment.

> The gist of the issue is that SEH unwinding has certain invariants around call instructions. One of those is that a call instruction must not be immediately followed by the function epilogue. Failing to do so leads to Windows' unwinder not recognizing the frame and skipping it when unwinding the stack.

Hmm, I was aware that this was an issue if the function ended with a non-returning call, like the testcase added in D119644 <https://reviews.llvm.org/D119644>, but I wasn't aware that this was an issue also for a call directly followed by the epilogue in a regular function. I would expect that to happen a lot more often.

(I'm not contradicting the statement here - I'm just not very experienced with the x86_64 SEH cases. For ARM/ARM64 SEH, these details are much more tightly defined, and such tweaks aren't luckily really needed there.)

I think the change looks reasonable, but I'm not really very familiar in this layer. I guess @rnk would be the best authority here, but he's away... Adding @efriedma who usually is knowledgeable on these things.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143812



More information about the llvm-commits mailing list