summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-09-20 17:05:04 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-09-20 17:05:04 +0000
commit03ffa797ad4fe8f85da532aa3f687841a60b4c0c (patch)
tree82e20815f9c9291b8fa733bebb6d659dd58bc83e /llvm/lib
parentc8e7c98b66051cc0a93f4efaa3410da3db059d31 (diff)
downloadbcm5719-llvm-03ffa797ad4fe8f85da532aa3f687841a60b4c0c.tar.gz
bcm5719-llvm-03ffa797ad4fe8f85da532aa3f687841a60b4c0c.zip
X86: loosen an overly aggressive MachO assertion
We would assert that the FP setup CFI used esp/rsp always. This held up in practice when the code was generated from IR. However, with the integrated assembler, it is possible to have the input be user specified assembly. In such a case, we cannot assume that the function implementation has a compact unwind representation. Loosen the assertion into a check and bail if we cannot represent the frame pointer in the compact unwinding. Addresses PR30453! llvm-svn: 281986
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
index 524b48b9aab..1bde4bcfa29 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
@@ -546,8 +546,12 @@ protected:
// .cfi_def_cfa_register %rbp
//
HasFP = true;
- assert(MRI.getLLVMRegNum(Inst.getRegister(), true) ==
- (Is64Bit ? X86::RBP : X86::EBP) && "Invalid frame pointer!");
+
+ // If the frame pointer is other than esp/rsp, we do not have a way to
+ // generate a compact unwinding representation, so bail out.
+ if (MRI.getLLVMRegNum(Inst.getRegister(), true) !=
+ (Is64Bit ? X86::RBP : X86::EBP))
+ return 0;
// Reset the counts.
memset(SavedRegs, 0, sizeof(SavedRegs));
OpenPOWER on IntegriCloud