OSDN Git Service

runtime: Tweak __go_can_recover for SPARC.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 11 Feb 2012 00:15:54 +0000 (00:15 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 11 Feb 2012 00:15:54 +0000 (00:15 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184117 138bc75d-0d04-0410-961f-82ee72b054a4

libgo/runtime/go-recover.c

index 7101d51..d6403e0 100644 (file)
@@ -43,6 +43,14 @@ __go_can_recover (const void* retaddr)
      such as an instruction to adjust the stack pointer.  */
 
   ret = (const char *) 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;
 }
   dret = (const char *) d->__retaddr;
   return ret <= dret && ret + 16 >= dret;
 }