summaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-03-01 20:30:14 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-03-01 20:30:14 +0000
commitfa23dea95e6b361e3db9cb88215aa55357241fe0 (patch)
tree7aa1dd831c440632d40a33266751c438c949ec0e /gcc/libgcc2.c
parent0e7cd28c7674f14b5b55e09565d1edbedfaa7276 (diff)
downloadgcc-fa23dea95e6b361e3db9cb88215aa55357241fe0.tar.gz
Clone unwind_function for powerpc
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9103 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index b8891dab631..39598efb038 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -2298,7 +2298,25 @@ __unwind_function(void *ptr)
asm("# br");
asm("mtctr 3;bctr # b 3");
}
-#endif
+#endif /* rs6000 */
+
+#if #machine(powerpc)
+__unwind_function(void *ptr)
+{
+ asm("mr 31,1");
+ asm("lwz 1,0(1)");
+ asm("lwz 31,-4(1)");
+ asm("# br");
+
+ asm("mr 31,1");
+ asm("lwz 1,0(1)");
+ /* use 31 as a scratch register to restore the link register. */
+ asm("lwz 31, 8(1);mtlr 31 # l lr,8(1)");
+ asm("lwz 31,-4(1)");
+ asm("# br");
+ asm("mtctr 3;bctr # b 3");
+}
+#endif /* powerpc */
#endif /* L_eh */
#ifdef L_pure