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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 31 12:23:18 PDT 2019


mstorsjo added a comment.

This broke one exception handling test case of mine. Curiously enough, it broke SEH unwinding in wine, but not on windows 10. In wine, it gives an error that looks like this:

  0092:err:seh:setup_exception stack overflow 4832 bytes in thread 0092 eip 000000007bc91b16 esp 0000000000140330 stack 0x140000-0x142000-0x240000

The file that breaks is at https://martin.st/temp/seh-bug.cpp, built with `clang++ -target x86_64-w64-mingw32 seh-bug.cpp -c -o test.o -fuse-cxa-atexit`. The diff in generated code from this commit looks like this:

  --- seh-bug-pre.s       2019-08-31 22:09:02.317179362 +0300
  +++ seh-bug-post.s      2019-08-31 22:09:51.812133103 +0300
  @@ -57,6 +57,8 @@
                                           # kill: def $r8 killed $r8d
          movq    %rax, %rcx
          callq   __cxa_throw
  +       subq    $32, %rsp
  +       int3
   .Ltmp4:
          jmp     .LBB0_8
   .LBB0_5:                                # %lpad
  @@ -77,9 +79,7 @@
   .LBB0_7:                                # %eh.resume
          movq    72(%rsp), %rcx
          callq   _Unwind_Resume
  -       ud2
   .LBB0_8:                                # %unreachable
  -       ud2
   .Lfunc_end0:
          .seh_handlerdata
          .text

So I presume that the issue is that the new `int3` isn't at the end of the function where the previous double `ud2` were?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66980





More information about the llvm-commits mailing list