diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ba3f0d3610158ffa1cd7bf1a37a84e92f590c964..b8bc619c8ec84ebeb934cf7f08609b8c87dc1aaa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/sparc/linux-unwind.h b/gcc/config/sparc/linux-unwind.h index 44420663c50e1da24f7454729f75dfe8cac68eac..adfef6ec29d0275390cdc4255dfaede8a1670325 100644 --- a/gcc/config/sparc/linux-unwind.h +++ b/gcc/config/sparc/linux-unwind.h @@ -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 */