Ping: [PATCH, ARM][1 of 2] Add epilogue dwarf info for shrink-wrap

Zhenqiang Chen zhenqiang.chen@linaro.org
Tue Apr 2 10:10:00 GMT 2013


Ping.

On 21 March 2013 14:58, Zhenqiang Chen <zhenqiang.chen@linaro.org> wrote:
> Hi,
>
> When shrink-wrap is enabled, the "returns" from simple-return path and
> normal return path can be merged. The code is like:
>
>      tst ...
>      /  \
>     |  push ...
>     |  ...
>     |  pop ...
>      \  /
>      bx lr
>
> If the dwarf info after "pop ..." is incorrect, the dwarf checks will
> fail at dwarf2cfi.c: function maybe_record_trace_start.
>
>       /* We ought to have the same state incoming to a given trace no
>          matter how we arrive at the trace.  Anything else means we've
>          got some kind of optimization error.  */
>       gcc_checking_assert (cfi_row_equal_p (cur_row, ti->beg_row));
>
> The patch is to add epilogue dwarf info to make sure:
>
> Before "bx lr",
> * All registers saved in stack had been "restored".
> * .cfi_def_cfa_offset 0
> * .cfi_def_cfa_register is sp even if frame_pointer_needed
>
> Boot strapped and no make check regression.
>
> Is it OK?
>
> Thanks!
> -Zhenqiang
>
> ChangeLog:
> 2013-03-21 Zhenqiang Chen <zhenqiang.chen@linaro.org>
>
>         * config/arm/arm.c (arm_add_cfa_adjust_cfa_note): New added.
>         (arm_emit_multi_reg_pop): Add REG_CFA_ADJUST_CFA notes.
>         (arm_emit_vfp_multi_reg_pop): Likewise.
>         (thumb2_emit_ldrd_pop): Likewise.
>         (arm_expand_epilogue): Add misc REG_CFA notes.
>         (arm_unwind_emit): Skip REG_CFA_ADJUST_CFA and REG_CFA_RESTORE.



More information about the Gcc-patches mailing list