This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] First attempt at unwind epilogue support for s390{,x}

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]