summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-11-13 21:27:00 +0000
committerReid Kleckner <rnk@google.com>2015-11-13 21:27:00 +0000
commit75b4be9a1198c53384980eadca2708628b97622c (patch)
treef12c5cb7442b9338145c652f46a5bfdfcec4d201 /llvm/test/CodeGen/X86
parent447bbdb17134e9463e45d41610b9e0dd73323dcf (diff)
downloadbcm5719-llvm-75b4be9a1198c53384980eadca2708628b97622c.tar.gz
bcm5719-llvm-75b4be9a1198c53384980eadca2708628b97622c.zip
[WinEH] Fix ESP management with 32-bit __CxxFrameHandler3
The C++ EH personality automatically restores ESP from the C++ EH registration node after a catchret. I mistakenly thought it was like SEH, which does not restore ESP. It makes sense for C++ EH to differ from SEH here because SEH does not use funclets for catches, and does not allow catching inside of finally. C++ EH may need to unwind through multiple catch funclets and eventually catchret to some outer funclet. Therefore, the runtime has to keep track of which ESP to use with catchret, rather than having the compiler reload it manually. llvm-svn: 253084
Diffstat (limited to 'llvm/test/CodeGen/X86')
-rw-r--r--llvm/test/CodeGen/X86/catchret-fallthrough.ll1
-rw-r--r--llvm/test/CodeGen/X86/win-catchpad-csrs.ll1
-rw-r--r--llvm/test/CodeGen/X86/win-catchpad.ll12
3 files changed, 6 insertions, 8 deletions
diff --git a/llvm/test/CodeGen/X86/catchret-fallthrough.ll b/llvm/test/CodeGen/X86/catchret-fallthrough.ll
index 497f6fb3a9d..f732566d0cb 100644
--- a/llvm/test/CodeGen/X86/catchret-fallthrough.ll
+++ b/llvm/test/CodeGen/X86/catchret-fallthrough.ll
@@ -41,6 +41,5 @@ nrvo.skipdtor: ; preds = %invoke.cont.3, %inv
; CHECK-NOT: jmp
; CHECK-NOT: movl {{.*}}, %esp
; CHECK: retl
-; CHECK: movl {{.*}}, %esp
; CHECK: addl $12, %ebp
; CHECK: jmp LBB0_{{.*}}
diff --git a/llvm/test/CodeGen/X86/win-catchpad-csrs.ll b/llvm/test/CodeGen/X86/win-catchpad-csrs.ll
index f759a4ef0d9..b6b4a9319b0 100644
--- a/llvm/test/CodeGen/X86/win-catchpad-csrs.ll
+++ b/llvm/test/CodeGen/X86/win-catchpad-csrs.ll
@@ -67,7 +67,6 @@ catchendblock: ; preds = %catch,
; X86: retl
; X86: [[restorebb:LBB0_[0-9]+]]:
-; X86: movl -16(%ebp), %esp
; X86: addl $12, %ebp
; X86: jmp [[contbb]]
diff --git a/llvm/test/CodeGen/X86/win-catchpad.ll b/llvm/test/CodeGen/X86/win-catchpad.ll
index 826fae522a3..d9c8307cb08 100644
--- a/llvm/test/CodeGen/X86/win-catchpad.ll
+++ b/llvm/test/CodeGen/X86/win-catchpad.ll
@@ -66,6 +66,7 @@ catchendblock: ; preds = %catch, %catch.2, %c
}
; X86-LABEL: _try_catch_catch:
+; X86: movl %esp, -[[sp_offset:[0-9]+]](%ebp)
; X86: movl $0, -{{[0-9]+}}(%ebp)
; X86: leal -[[local_offs:[0-9]+]](%ebp), %[[addr_reg:[a-z]+]]
; X86-DAG: movl %[[addr_reg]], 4(%esp)
@@ -76,15 +77,13 @@ catchendblock: ; preds = %catch, %catch.2, %c
; X86: [[restorebb1:LBB0_[0-9]+]]: # Block address taken
; X86-NEXT: # %invoke.cont.2
-; X86: movl -16(%ebp), %esp
-; X86: addl $12, %ebp
+; X86-NEXT: addl $12, %ebp
; X86: jmp [[contbb]]
; FIXME: These should be de-duplicated.
; X86: [[restorebb2:LBB0_[0-9]+]]: # Block address taken
; X86-NEXT: # %invoke.cont.3
-; X86: movl -16(%ebp), %esp
-; X86: addl $12, %ebp
+; X86-NEXT: addl $12, %ebp
; X86: jmp [[contbb]]
; X86: "?catch$[[catch1bb:[0-9]+]]@?0?try_catch_catch@4HA":
@@ -92,6 +91,7 @@ catchendblock: ; preds = %catch, %catch.2, %c
; X86: pushl %ebp
; X86: subl $8, %esp
; X86: addl $12, %ebp
+; X86: movl %esp, -[[sp_offset]](%ebp)
; X86: leal -[[local_offs]](%ebp), %[[addr_reg:[a-z]+]]
; X86: movl -32(%ebp), %[[e_reg:[a-z]+]]
; X86: movl $1, -{{[0-9]+}}(%ebp)
@@ -108,6 +108,7 @@ catchendblock: ; preds = %catch, %catch.2, %c
; X86: pushl %ebp
; X86: subl $8, %esp
; X86: addl $12, %ebp
+; X86: movl %esp, -[[sp_offset]](%ebp)
; X86: leal -[[local_offs]](%ebp), %[[addr_reg:[a-z]+]]
; X86: movl $1, -{{[0-9]+}}(%ebp)
; X86-DAG: movl %[[addr_reg]], 4(%esp)
@@ -258,8 +259,7 @@ catchendblock:
; X86: [[restorebb:LBB1_[0-9]+]]: # Block address taken
; X86-NEXT: # %catch.done
-; X86: movl -16(%ebp), %esp
-; X86: addl $12, %ebp
+; X86-NEXT: addl $12, %ebp
; X86: jmp [[contbb]]
; X86: "?catch$[[catchdispbb:[0-9]+]]@?0?branch_to_normal_dest@4HA":
OpenPOWER on IntegriCloud