This is the mail archive of the gcc-patches@gcc.gnu.org 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@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.

As I said in my reply to Richard, I think the default unwinder behaviour
doesn't handle that biased CFG correctly, that's why we restore SP and CFG
independently ...

> dwarf2out.c calls next_real_insn on the return insn (125 in this case)
> to find out if there is some further basic block for which unwind info
> needs to be provided and finds insn 131.  Can't s390 use some other rtx
> for the literal pool stuff (e.g. NOTE)?  Or should dwarf2out.c search
> for a label with non-0 uses and next_real_insn only after that?

The problem is that we need the literal pool (when it is intermixed
with code) to participate in the shorten_branches () and insn length
computations.  That's why we use UNSPEC_VOLATILE insns ...

However, it is of course true that this not code, and therefore does
not require CFI.  I'm not sure how to provide that information at
the RTL level -- maybe a new UNSPEC_DATA instead?  Or some REG_NOTE?

> @@ -7999,6 +8014,11 @@ s390_emit_epilogue (bool sibcall)
>  	   i <= cfun_frame_layout.last_restore_gpr;
>  	   i++)
>  	{
> +	  if (i != STACK_POINTER_REGNUM)
> +	    cfa_restores
> +	      = alloc_reg_note (REG_CFA_RESTORE,
> +				gen_rtx_REG (Pmode, i), cfa_restores);
> +

As mentioned above, I think we need one for SP as well.

(However, we probably should *not* have a restore note for those
global registers that this loop prevents from being restored ...)

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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