[PATCH] D66980: [Windows] Disable TrapUnreachable for Win64, add SEH_NoReturn

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 13:05:09 PDT 2019


rnk added a comment.

In D66980#1651911 <https://reviews.llvm.org/D66980#1651911>, @thakis wrote:

> Why expand to int3 instead of nop?


If we have to emit some code, it seems better to trap than to fall through off the end of a function into the next. MSVC uses int3, although last I checked they use it for all noreturn functions: https://gcc.godbolt.org/z/3GO_d2.

Related to this int3 stuff, I've also seen that MSVC emits nops after calls at the end of EH scopes. See the `npad 1` at the end of this try block: https://gcc.godbolt.org/z/qOLw5-
LLVM instead adds one to each label used in the EH table, which assumes every call is at least one byte.

It's also possible that I've misdiagnosed the problem, the problem might not be in the unwinder, it could be in the C++ EH personality. Maybe I should rewrite the commit a bit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66980





More information about the llvm-commits mailing list