aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-02-11 00:15:54 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-02-11 00:15:54 +0000
commit96431d57723de569bd75407cf7252699b491cbbe (patch)
tree30649c46a83484faba7d2f4d0bb9da8a2fb6561f /libgo
parent8c92f3e81be19ed6f544c06ee313af0cf5af107b (diff)
downloadgcc-96431d57723de569bd75407cf7252699b491cbbe.zip
gcc-96431d57723de569bd75407cf7252699b491cbbe.tar.gz
gcc-96431d57723de569bd75407cf7252699b491cbbe.tar.bz2
runtime: Tweak __go_can_recover for SPARC.
From-SVN: r184117
Diffstat (limited to 'libgo')
-rw-r--r--libgo/runtime/go-recover.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/runtime/go-recover.c b/libgo/runtime/go-recover.c
index 7101d51..d6403e0 100644
--- a/libgo/runtime/go-recover.c
+++ b/libgo/runtime/go-recover.c
@@ -43,6 +43,14 @@ __go_can_recover (const void* retaddr)
such as an instruction to adjust the stack pointer. */
ret = (const char *) retaddr;
+
+#ifdef __sparc__
+ /* On SPARC the address we get, from __builtin_return_address, is
+ the address of the call instruction. Adjust forward, also
+ skipping the delayed instruction following the call. */
+ ret += 8;
+#endif
+
dret = (const char *) d->__retaddr;
return ret <= dret && ret + 16 >= dret;
}