diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-03-03 00:01:25 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-03-03 00:01:25 +0000 |
commit | 1ef654024f490b403494265c968570ca6bd800f3 (patch) | |
tree | 8915b153475cd3e51343662f1764be4d0b78a497 /llvm/lib/CodeGen/StackColoring.cpp | |
parent | fe5a7109c5f800310dc7b0bb7626a835423c7dd5 (diff) | |
download | bcm5719-llvm-1ef654024f490b403494265c968570ca6bd800f3.tar.gz bcm5719-llvm-1ef654024f490b403494265c968570ca6bd800f3.zip |
[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
Diffstat (limited to 'llvm/lib/CodeGen/StackColoring.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackColoring.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp index 984ce470c6f..852db5d2a01 100644 --- a/llvm/lib/CodeGen/StackColoring.cpp +++ b/llvm/lib/CodeGen/StackColoring.cpp @@ -249,11 +249,13 @@ unsigned StackColoring::collectMarkers(unsigned NumSlot) { MI.getOpcode() != TargetOpcode::LIFETIME_END) continue; - Markers.push_back(&MI); - bool IsStart = MI.getOpcode() == TargetOpcode::LIFETIME_START; const MachineOperand &MO = MI.getOperand(0); - unsigned Slot = MO.getIndex(); + int Slot = MO.getIndex(); + if (Slot < 0) + continue; + + Markers.push_back(&MI); MarkersFound++; @@ -393,7 +395,8 @@ void StackColoring::calculateLiveIntervals(unsigned NumSlots) { bool IsStart = MI->getOpcode() == TargetOpcode::LIFETIME_START; const MachineOperand &Mo = MI->getOperand(0); int Slot = Mo.getIndex(); - assert(Slot >= 0 && "Invalid slot"); + if (Slot < 0) + continue; SlotIndex ThisIndex = Indexes->getInstructionIndex(*MI); |