This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] First attempt at unwind epilogue support for s390{,x}
- From: Richard Henderson <rth at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>, Andreas dot Krebbel at de dot ibm dot com, gcc-patches at gcc dot gnu dot org
- Date: Tue, 02 Jun 2009 14:31:09 -0700
- Subject: Re: [PATCH] First attempt at unwind epilogue support for s390{,x}
- References: <20090602205223.GN18874@tyan-ft48-01.lab.bos.redhat.com>
Jakub Jelinek wrote:
As %r15 is the stack pointer (CFA is %r15 + (TARGET_64BIT ? 160 : 96)),
I believe having DW_CFA_offset/DW_CFA_restore for %r15 doesn't make sense,
the unwinders will restore %r15 from computing the CFA.
I don't believe that's true. I remember having to make exactly
this change to the unwinder so that unwinding from a signal frame
would happen properly. Indeed:
/* If the target frame does not have a saved stack pointer,
then set up the target's CFA. */
if (!_Unwind_GetGRPtr (target, __builtin_dwarf_sp_column ()))
_Unwind_SetSpColumn (target, target->cfa, &sp_slot);
Also, I believe the reason S390 does things this way is that at
least one of the OS's have discontiguous stack frames, so I think
this change is actively wrong.
> The reason for this is
the weird way how s390{,x} emits literal pool:
(jump_insn 125 124 126 aq.c:19 (parallel [
... that's unfortunate. I how difficult it would be to standardize
literal pools across the various targets.
+ REG_NOTES (insn) = cfa_restores;
+ add_reg_note (insn, REG_CFA_DEF_CFA,
+ plus_constant (stack_pointer_rtx, STACK_POINTER_OFFSET));
Given the above, I might think that the only safe CFA definition
for the return insn is CFA = SP + 0.
r~