This is the mail archive of the
mailing list for the GCC project.
[Ping^2] [PATCH, ARM][1 of 2] Add epilogue dwarf info for shrink-wrap
- From: Zhenqiang Chen <zhenqiang dot chen at linaro dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, Matthew Gretton-Dann <matthew dot gretton-dann at linaro dot org>
- Date: Sun, 28 Apr 2013 14:21:35 +0800
- Subject: [Ping^2] [PATCH, ARM][1 of 2] Add epilogue dwarf info for shrink-wrap
On 2 April 2013 17:54, Zhenqiang Chen <firstname.lastname@example.org> wrote:
> On 21 March 2013 14:58, Zhenqiang Chen <email@example.com> wrote:
>> 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?
>> 2013-03-21 Zhenqiang Chen <firstname.lastname@example.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.