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: [AArch64] fix missing Dwarf call frame information in the epilogue


Hi,

Many thanks for reviewing. Please find the updated patch. The explicit calls to gen_rtx_PLUS and GEN_INT have been replaced by plus_constant, and the call to aarch64_set_frame_expr has been replaced with add_reg_note (REG_CFA_ADJUST_CFA).

I'll clean up other cases in aarch64.c in a separate patch.

OK to commit?

Thanks,
Yufeng


gcc/ChangeLog


2012-11-06 Yufeng Zhang <yufeng.zhang@arm.com>

         * config/aarch64/aarch64.c (aarch64_expand_prologue): For the
         load-pair with writeback instruction, replace
         aarch64_set_frame_expr with add_reg_note (REG_CFA_ADJUST_CFA);
         add new local variable 'cfa_reg' and use it.

gcc/testsuite/ChangeLog

2012-11-06 Yufeng Zhang <yufeng.zhang@arm.com>

* gcc.target/aarch64/dwarf-cfa-reg.c: New file.


On 09/12/12 19:37, Richard Henderson wrote:
On 09/12/2012 09:10 AM, Yufeng Zhang wrote:
  	aarch64_set_frame_expr (gen_rtx_SET
  				      (Pmode,
  				       stack_pointer_rtx,
-				       gen_rtx_PLUS (Pmode, stack_pointer_rtx,
+				       gen_rtx_PLUS (Pmode, cfa_reg,
  						     GEN_INT (offset))));

We'd prefer to use


plus_constant (Pmode, cfa_reg, offset)

instead of the explicit call to gen_rtx_PLUS and GEN_INT.
It would appear that the entire aarch64.c file ought to
be audited for that.

Also, use of the REG_CFA_* notes is strongly encouraged over
use of REG_FRAME_RELATED_EXPR.

There's all sorts of work involved in turning R_F_R_E into
R_CFA_* notes, depending on a rather large state machine.
This state machine was developed when only prologues were
annotated for unwinding, and therefore one cannot expect it
to work reliably for epilogues.

A long-term goal is to convert all targets to use R_CFA_*
exclusively, as that preserves much more information present
in the structure of the code of the prologue generator.  It
means less work within the compiler, and eventually being able
to remove a rather large hunk of state-machine code.


r~


Attachment: gcc-epilogue-cfa-def-reg.patch.v2
Description: Text document


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