This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix remaining Java failures on SPARC64/Linux
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Dec 2009 22:09:33 +0100
- Subject: Fix remaining Java failures on SPARC64/Linux
This fixes the 3 remaining Java failures on SPARC64/Linux, which pertain to
unwinding through a signal raised from a leaf function. A small adjustment
is necessary on SPARC64 because of the stack bias; it is already present in
the Solaris unwinder.
Tested on SPARC64/Linux, applied on the mainline.
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.
--
Eric Botcazou
Index: config/sparc/linux-unwind.h
===================================================================
--- config/sparc/linux-unwind.h (revision 155123)
+++ config/sparc/linux-unwind.h (working copy)
@@ -98,6 +98,23 @@ sparc64_fallback_frame_state (struct _Un
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 */