[WinEH] Fix stack alignment in funclets and ParentFrameOffset calculation
authorReid Kleckner <rnk@google.com>
Fri, 16 Oct 2015 23:43:27 +0000 (23:43 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 16 Oct 2015 23:43:27 +0000 (23:43 +0000)
commit610dd981a33c9cbb9f55071b7752746d9c3efd3a
treeb9e58f1d8d543f47169ec7a4c11994f5667f4570
parentdd65b7a9f542ec5588abff7ffa47b8653fa53fea
[WinEH] Fix stack alignment in funclets and ParentFrameOffset calculation

Our previous value of "16 + 8 + MaxCallFrameSize" for ParentFrameOffset
is incorrect when CSRs are involved. We were supposed to have a test
case to catch this, but it wasn't very rigorous.

The main effect here is that calling _CxxThrowException inside a
catchpad doesn't immediately crash on MOVAPS when you have an odd number
of CSRs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250583 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetFrameLowering.h
lib/CodeGen/AsmPrinter/WinException.cpp
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86FrameLowering.h
test/CodeGen/X86/win-catchpad-csrs.ll