From db38d7657a6818c87be0954c5325bec6ae12a8ed Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 7 Jul 2015 15:47:29 +0000 Subject: [PATCH] [WinEH] Add a report_fatal_error for 32-bit stack realignment This type of prologue isn't supported yet. Implementing it should be a matter of copying the adjusted incoming EBP into ESI (the base pointer) instead of EBP. The original EBP can be saved and restored from other memory afterwards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241597 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86ISelLowering.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 1a21efcd575..b16bb4c6769 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -15953,6 +15953,9 @@ static SDValue LowerSEHRESTOREFRAME(SDValue Op, const X86Subtarget *Subtarget, SDLoc dl(Op); SDValue Chain = Op.getOperand(0); + assert(Subtarget->getFrameLowering()->hasFP(MF) && + "using llvm.x86.seh.restoreframe requires a frame pointer"); + const TargetLowering &TLI = DAG.getTargetLoweringInfo(); MVT VT = TLI.getPointerTy(); @@ -15974,6 +15977,8 @@ static SDValue LowerSEHRESTOREFRAME(SDValue Op, const X86Subtarget *Subtarget, Chain = DAG.getCopyToReg(Chain, dl, SPReg, NewSP); // FIXME: Restore the base pointer in case of stack realignment! + if (RegInfo->needsStackRealignment(MF)) + report_fatal_error("SEH with stack realignment not yet implemented"); // Adjust EBP to point back to the original frame position. SDValue NewFP = recoverFramePointer(DAG, MF.getFunction(), IncomingEBP); -- 2.34.1