summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86FrameLowering.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-07-16 12:27:59 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-07-16 12:27:59 +0000
commite1ea4e7d159edd6a2485f10ec89ff60118f5b0ce (patch)
tree0dd0ab5f495305cdbdde65bc096c91e7d9021879 /llvm/lib/Target/X86/X86FrameLowering.cpp
parent8c3b4f2e78fb9e7c16a464062192f2796ab3650c (diff)
downloadbcm5719-llvm-e1ea4e7d159edd6a2485f10ec89ff60118f5b0ce.tar.gz
bcm5719-llvm-e1ea4e7d159edd6a2485f10ec89ff60118f5b0ce.zip
[X86] Fix emitPrologue() to make less assumptions about pushes
When X86FrameLowering::emitPrologue() looks for where to insert the %esp subtraction to allocate stack space for local allocations, it assumes that any sequence of push instructions that starts at function entry consists purely of spills of callee-save registers. This may be false, since from some point forward, the pushes may pushing arguments to a subsequent function call. This caused a miscompile that was exposed by r240257, and is not easily testable since r240257 was reverted. A test will be committed separately after r240257 is reapplied. llvm-svn: 242395
Diffstat (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86FrameLowering.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 2a35c4cf31f..edbe7d0894a 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -794,6 +794,7 @@ void X86FrameLowering::emitPrologue(MachineFunction &MF,
int StackOffset = 2 * stackGrowth;
while (MBBI != MBB.end() &&
+ MBBI->getFlag(MachineInstr::FrameSetup) &&
(MBBI->getOpcode() == X86::PUSH32r ||
MBBI->getOpcode() == X86::PUSH64r)) {
PushedRegs = true;
OpenPOWER on IntegriCloud