[X86] Don't give catch objects a displacement of zero
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 3 Mar 2016 00:01:25 +0000 (00:01 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 3 Mar 2016 00:01:25 +0000 (00:01 +0000)
commit1ef654024f490b403494265c968570ca6bd800f3
tree8915b153475cd3e51343662f1764be4d0b78a497
parentfe5a7109c5f800310dc7b0bb7626a835423c7dd5
[X86] Don't give catch objects a displacement of zero

Catch objects with a displacement of zero do not initialize a catch
object.  The displacement is relative to %rsp at the end of the
function's prologue for x86_64 targets.

If we place an object at the top-of-stack, we will end up wit a
displacement of zero resulting in our catch object remaining
uninitialized.

Address this by creating our catch objects as fixed objects.  We will
ensure that the UnwindHelp object is created after the catch objects so
that no catch object will have a displacement of zero.

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

llvm-svn: 262546
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
llvm/lib/CodeGen/StackColoring.cpp
llvm/lib/Target/X86/X86FrameLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Target/X86/X86ISelLowering.h
llvm/test/CodeGen/X86/catchpad-dynamic-alloca.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/catchpad-lifetime.ll
llvm/test/CodeGen/X86/win-catchpad.ll