mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
Disable FP elimination in funcs using 32-bit MSVC EH personalities
The value in 'ebp' acts as an implicit argument to the outlined handlers, and is recovered with frameaddress(1). llvm-svn: 238619
This commit is contained in:
parent
27d0b57917
commit
44a9f03b05
@ -155,6 +155,11 @@ bool WinEHStatePass::runOnFunction(Function &F) {
|
||||
if (!isMSVCEHPersonality(Personality))
|
||||
return false;
|
||||
|
||||
// Disable frame pointer elimination in this function.
|
||||
// FIXME: Do the nested handlers need to keep the parent ebp in ebp, or can we
|
||||
// use an arbitrary register?
|
||||
F.addFnAttr("no-frame-pointer-elim", "true");
|
||||
|
||||
emitExceptionRegistrationRecord(&F);
|
||||
|
||||
auto *MMIPtr = getAnalysisIfAvailable<MachineModuleInfo>();
|
||||
|
@ -90,14 +90,14 @@ eh.resume: ; preds = %catch.dispatch.4
|
||||
}
|
||||
|
||||
; CHECK-LABEL: _f:
|
||||
; CHECK: movl $-1, [[state:[0-9]+]](%esp)
|
||||
; CHECK: movl $-1, [[state:[-0-9]+]](%ebp)
|
||||
; CHECK: movl $___ehhandler$f, {{.*}}
|
||||
;
|
||||
; CHECK: movl $0, [[state]](%esp)
|
||||
; CHECK: movl $0, [[state]](%ebp)
|
||||
; CHECK: movl $1, (%esp)
|
||||
; CHECK: calll _may_throw
|
||||
;
|
||||
; CHECK: movl $1, [[state]](%esp)
|
||||
; CHECK: movl $1, [[state]](%ebp)
|
||||
; CHECK: movl $2, (%esp)
|
||||
; CHECK: calll _may_throw
|
||||
|
||||
|
@ -19,16 +19,18 @@ catchall:
|
||||
}
|
||||
|
||||
; CHECK-LABEL: _use_except_handler3:
|
||||
; CHECK: pushl %ebp
|
||||
; CHECK: movl %esp, %ebp
|
||||
; CHECK: subl ${{[0-9]+}}, %esp
|
||||
; CHECK: movl $-1, 12(%esp)
|
||||
; CHECK: movl $L__ehtable$use_except_handler3, 8(%esp)
|
||||
; CHECK: movl $__except_handler3, 4(%esp)
|
||||
; CHECK: movl $-1, -4(%ebp)
|
||||
; CHECK: movl $L__ehtable$use_except_handler3, -8(%ebp)
|
||||
; CHECK: movl $__except_handler3, -12(%ebp)
|
||||
; CHECK: movl %fs:0, %[[next:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], (%esp)
|
||||
; CHECK: leal (%esp), %[[node:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], -16(%ebp)
|
||||
; CHECK: leal -16(%ebp), %[[node:[^ ,]*]]
|
||||
; CHECK: movl %[[node]], %fs:0
|
||||
; CHECK: calll _may_throw_or_crash
|
||||
; CHECK: movl (%esp), %[[next:[^ ,]*]]
|
||||
; CHECK: movl -16(%ebp), %[[next:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], %fs:0
|
||||
; CHECK: retl
|
||||
|
||||
@ -44,17 +46,19 @@ catchall:
|
||||
}
|
||||
|
||||
; CHECK-LABEL: _use_except_handler4:
|
||||
; CHECK: pushl %ebp
|
||||
; CHECK: movl %esp, %ebp
|
||||
; CHECK: subl ${{[0-9]+}}, %esp
|
||||
; CHECK: movl %esp, (%esp)
|
||||
; CHECK: movl $-1, 20(%esp)
|
||||
; CHECK: movl $L__ehtable$use_except_handler4, 4(%esp)
|
||||
; CHECK: leal 8(%esp), %[[node:[^ ,]*]]
|
||||
; CHECK: movl $__except_handler4, 12(%esp)
|
||||
; CHECK: movl %esp, -24(%ebp)
|
||||
; CHECK: movl $-1, -4(%ebp)
|
||||
; CHECK: movl $L__ehtable$use_except_handler4, -20(%ebp)
|
||||
; CHECK: leal -16(%ebp), %[[node:[^ ,]*]]
|
||||
; CHECK: movl $__except_handler4, -12(%ebp)
|
||||
; CHECK: movl %fs:0, %[[next:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], 8(%esp)
|
||||
; CHECK: movl %[[next]], -16(%ebp)
|
||||
; CHECK: movl %[[node]], %fs:0
|
||||
; CHECK: calll _may_throw_or_crash
|
||||
; CHECK: movl 8(%esp), %[[next:[^ ,]*]]
|
||||
; CHECK: movl -16(%ebp), %[[next:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], %fs:0
|
||||
; CHECK: retl
|
||||
|
||||
@ -73,17 +77,19 @@ catchall:
|
||||
}
|
||||
|
||||
; CHECK-LABEL: _use_CxxFrameHandler3:
|
||||
; CHECK: pushl %ebp
|
||||
; CHECK: movl %esp, %ebp
|
||||
; CHECK: subl ${{[0-9]+}}, %esp
|
||||
; CHECK: movl %esp, (%esp)
|
||||
; CHECK: movl $-1, 12(%esp)
|
||||
; CHECK: leal 4(%esp), %[[node:[^ ,]*]]
|
||||
; CHECK: movl $___ehhandler$use_CxxFrameHandler3, 8(%esp)
|
||||
; CHECK: movl %esp, -16(%ebp)
|
||||
; CHECK: movl $-1, -4(%ebp)
|
||||
; CHECK: leal -12(%ebp), %[[node:[^ ,]*]]
|
||||
; CHECK: movl $___ehhandler$use_CxxFrameHandler3, -8(%ebp)
|
||||
; CHECK: movl %fs:0, %[[next:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], 4(%esp)
|
||||
; CHECK: movl %[[next]], -12(%ebp)
|
||||
; CHECK: movl %[[node]], %fs:0
|
||||
; CHECK: movl $0, 12(%esp)
|
||||
; CHECK: movl $0, -4(%ebp)
|
||||
; CHECK: calll _may_throw_or_crash
|
||||
; CHECK: movl 4(%esp), %[[next:[^ ,]*]]
|
||||
; CHECK: movl -12(%ebp), %[[next:[^ ,]*]]
|
||||
; CHECK: movl %[[next]], %fs:0
|
||||
; CHECK: retl
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user