Fix failure to invoke exception handler on Win64
authorReid Kleckner <reid@kleckner.net>
Mon, 4 Aug 2014 21:05:27 +0000 (21:05 +0000)
committerReid Kleckner <reid@kleckner.net>
Mon, 4 Aug 2014 21:05:27 +0000 (21:05 +0000)
commit0b04cf6e7150d25a1e1746d6dbe00a2459eaedd0
tree10efca5158f90572d2dcfe893ef2dea27823e58a
parent1bb69f17d81559987a4ad4819487b1630934005e
Fix failure to invoke exception handler on Win64

When the last instruction prior to a function epilogue is a call, we
need to emit a nop so that the return address is not in the epilogue IP
range.  This is consistent with MSVC's behavior, and may be a workaround
for a bug in the Win64 unwinder.

Differential Revision: http://reviews.llvm.org/D4751

Patch by Vadim Chugunov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214775 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86InstrCompiler.td
lib/Target/X86/X86MCInstLower.cpp
test/CodeGen/X86/win64_call_epi.ll [new file with mode: 0644]