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] PA DWARF2 EH Support


Richard Henderson <rth@redhat.com> writes:

> I committed this patch.  It does two things: 
> 
>   (1) Add the new hook needed by hppa64 for cfa calculation.
> 
>   (2) Fix some bugs in DW_CFA_def_cfa{_offset,}_sf.  We hadn't
>       been emitting them previously, and were consuming them
>       incorrectly.  This may affect ppc32, iirc, but should be
>       for the better.

It shouldn't affect ppc32.  It's actually not clear to me what
platforms this could possibly affect; the implication is that in order
to create a stack frame, the platform must *pop* from the stack.

Although many platforms do need negative CFA offsets, because pushing
on the stack involves decrementing it, they usually deal with it by

        .byte   0x7c    ; sleb128 -4; CIE Data Alignment Factor

a negative data alignment factor.  But maybe hppa64 is one of those
'red zone' platforms, where all the register saves happen first (and
therefore to positive offsets to the stack) and then the stack is
decremented, so it makes more sense to have the data alignment factor
be positive?  Yet, I think that normally even this is dealt with by
re-ordering the CIE operations.

> We might ought to backport the unwind-dw2.c patch to all active
> branches, but I'm not going to do this now.
> 
> Smoke tested on i686-linux.
> 
> 
> r~
> 
> 
>         * dwarf2out.c (dw_cfi_oprnd_struct): Reduce dw_cfi_reg_num to int.
>         (lookup_cfa_1): Apply data alignment to DW_CFA_def_cfa_offset_sf
>         and DW_CFA_def_cfa_sf.
>         (def_cfa_1): Use DW_CFA_def_cfa_offset_sf with negative values.
>         (dbx_reg_number): Don't assert particular registers here.
>         (based_loc_descr): ... do it here instead.  Fold in ...
>         (eliminate_reg_to_offset): ... this function.
>         (compute_frame_pointer_to_cfa_displacement): Fold in the effects
>         of eliminate_reg_to_offset; use FRAME_POINTER_CFA_OFFSET.
>         * unwind-dw2.c (execute_cfa_program): Apply data align factor
>         to DW_CFA_def_cfa_offset_sf and DW_CFA_def_cfa_sf.
>         * function.c (instantiate_new_reg): Use FRAME_POINTER_CFA_OFFSET.
>         (instantiate_virtual_regs): Likewise.
>         * var-tracking.c (adjust_stack_reference): Likewise.
>         * doc/tm.texi (FRAME_POINTER_CFA_OFFSET): New.


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