]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pr-support.c (__gnu_unwind_24bit): Correct logic for the case where B3 isn't the...
authorBernd Schmidt <bernds@codesourcery.com>
Tue, 25 Oct 2011 15:44:03 +0000 (15:44 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Tue, 25 Oct 2011 15:44:03 +0000 (15:44 +0000)
* config/c6x/pr-support.c (__gnu_unwind_24bit): Correct logic for the
case where B3 isn't the return register.

From-SVN: r180434

libgcc/ChangeLog
libgcc/config/c6x/pr-support.c

index 91068ce1f5041eb8da65b576bc99313f281776ca..e39fccc322c4cbc95ec5ff30da6b56f99601d849 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-25  Bernd Schmidt  <bernds@codesourcery.com>
+
+       * config/c6x/pr-support.c (__gnu_unwind_24bit): Correct logic for the
+       case where B3 isn't the return register.
+
 2011-10-25  Andreas Tobler  <andreast@fgznet.ch>
 
        * config/rs6000/t-freebsd: Add wildcard.
index 6375013cb6624aaa7481dd9d4af9d1c000c29303..e635a6033c26e363b20ed081c73fadb20acc5410 100644 (file)
@@ -273,6 +273,14 @@ __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
   _uw mask;
   _uw *ptr;
   _uw tmp;
+  int ret_reg = unwind_frame_regs[data & 0xf];
+
+  if (ret_reg != R_B3)
+    {
+      _Unwind_VRS_Get (context, _UVRSC_CORE, unwind_frame_regs[data & 0xf],
+                      _UVRSD_UINT32, &tmp);
+      _Unwind_VRS_Set (context, _UVRSC_CORE, R_B3, _UVRSD_UINT32, &tmp);
+    }
 
   mask = (data >> 4) & 0x1fff;
 
@@ -291,8 +299,7 @@ __gnu_unwind_24bit (_Unwind_Context * context, _uw data, int compact)
   else
     pop_frame (context, mask, ptr, offset != 0x7f);
 
-  _Unwind_VRS_Get (context, _UVRSC_CORE, unwind_frame_regs[data & 0xf],
-                  _UVRSD_UINT32, &tmp);
+  _Unwind_VRS_Get (context, _UVRSC_CORE, R_B3, _UVRSD_UINT32, &tmp);
   _Unwind_VRS_Set (context, _UVRSC_CORE, R_PC, _UVRSD_UINT32, &tmp);
 
   return _URC_OK;