linux-unwind.h (MD_FROB_UPDATE_CONTEXT, 64-bit): Define.
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 11 Dec 2009 21:06:18 +0000 (21:06 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 11 Dec 2009 21:06:18 +0000 (21:06 +0000)
* config/sparc/linux-unwind.h (MD_FROB_UPDATE_CONTEXT, 64-bit): Define.
(sparc64_frob_update_context): New function.

From-SVN: r155178

gcc/ChangeLog
gcc/config/sparc/linux-unwind.h

index ba3f0d3..b8bc619 100644 (file)
@@ -1,3 +1,8 @@
+2009-12-11  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * config/sparc/linux-unwind.h (MD_FROB_UPDATE_CONTEXT, 64-bit): Define.
+       (sparc64_frob_update_context): New function.
+
 2009-12-11  Richard Guenther  <rguenther@suse.de>
 
        PR lto/41658
index 4442066..adfef6e 100644 (file)
@@ -98,6 +98,23 @@ sparc64_fallback_frame_state (struct _Unwind_Context *context,
   return _URC_NO_REASON;
 }
 
+#define MD_FROB_UPDATE_CONTEXT sparc64_frob_update_context
+
+static void
+sparc64_frob_update_context (struct _Unwind_Context *context,
+                            _Unwind_FrameState *fs)
+{
+  /* The column of %sp contains the old CFA, not the old value of %sp.
+     The CFA offset already comprises the stack bias so, when %sp is the
+     CFA register, we must avoid counting the stack bias twice.  Do not
+     do that for signal frames as the offset is artificial for them.  */
+  if (fs->regs.cfa_reg == __builtin_dwarf_sp_column ()
+      && fs->regs.cfa_how == CFA_REG_OFFSET
+      && fs->regs.cfa_offset != 0
+      && !fs->signal_frame)
+    context->cfa -= 2047;
+}
+
 #else
 
 /* 32-bit SPARC version */