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]

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


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.

Attachment: 1-add-dwarf-info-on-epilogue.patch
Description: Binary data


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