summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FrameLowering.cpp
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2018-06-26 14:11:30 +0000
committerThan McIntosh <thanm@google.com>2018-06-26 14:11:30 +0000
commit3190993a023d5f4faf68f98a13bbf5272f23e650 (patch)
tree051699a33ae217690513ce9bd58d97c6c06e46b8 /llvm/lib/Target/X86/X86FrameLowering.cpp
parentcfe2f9d4d2d65417a9b28e439901b7a3f6de4dc0 (diff)
downloadbcm5719-llvm-3190993a023d5f4faf68f98a13bbf5272f23e650.tar.gz
bcm5719-llvm-3190993a023d5f4faf68f98a13bbf5272f23e650.zip
[X86,ARM] Retain split-stack prolog check for sibling calls
Summary: If a routine with no stack frame makes a sibling call, we need to preserve the stack space check even if the local stack frame is empty, since the call target could be a "no-split" function (in which case the linker needs to be able to fix up the prolog sequence in order to switch to a larger stack). This fixes PR37807. Reviewers: cherry, javed.absar Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D48444 llvm-svn: 335604
Diffstat (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86FrameLowering.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 18f62e06afa..a257ec41f75 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -2241,8 +2241,10 @@ void X86FrameLowering::adjustForSegmentedStacks(
// prologue.
StackSize = MFI.getStackSize();
- // Do not generate a prologue for functions with a stack of size zero
- if (StackSize == 0)
+ // Do not generate a prologue for leaf functions with a stack of size zero.
+ // For non-leaf functions we have to allow for the possibility that the
+ // call is to a non-split function, as in PR37807.
+ if (StackSize == 0 && !MFI.hasTailCall())
return;
MachineBasicBlock *allocMBB = MF.CreateMachineBasicBlock();
OpenPOWER on IntegriCloud