This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, DWARF] re-init dw_frame_pointer_regnum between functions
- From: Richard Henderson <rth at redhat dot com>
- To: Christian Bruel <christian dot bruel at st dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, richard dot earnshaw at arm dot com
- Date: Tue, 14 Oct 2014 11:29:52 -0700
- Subject: Re: [PATCH, DWARF] re-init dw_frame_pointer_regnum between functions
- Authentication-results: sourceware.org; auth=none
- References: <543D1EEE dot 5070903 at st dot com> <543D6A7C dot 3080702 at redhat dot com>
On 10/14/2014 11:25 AM, Richard Henderson wrote:
> On 10/14/2014 06:02 AM, Christian Bruel wrote:
>> 2014-09-23 Christian Bruel <email@example.com>
>> * execute_dwarf2_frame (dw_frame_pointer_regnum): Reinitialize for each function.
> It's tempting to make this a local variable within dwarf2out_frame_debug_expr
> and not try to cache it at all.
> But this is ok.
For the record, this also points out that the arm backend ought to be weaned
away from using dwarf2out_frame_debug_expr and use the REG_CFA_* notes
exclusively. That would also fix an apparent error in arm_expand_prologue:
if (IS_INTERRUPT (func_type))
/* Interrupt functions must not corrupt any registers.
Creating a frame pointer however, corrupts the IP
register, so we must push it first. */
emit_multi_reg_push (1 << IP_REGNUM, 1 << IP_REGNUM);
/* Do not set RTX_FRAME_RELATED_P on this insn.
The dwarf stack unwinding code only wants to see one
stack decrement per function, and this is not it. If
this instruction is labeled as being part of the frame
creation sequence then dwarf2out_frame_debug_expr will
die when it encounters the assignment of IP to FP
later on, since the use of SP here establishes SP as
the CFA register and not IP.
Anyway this instruction is not really part of the stack
frame creation although it is part of the prologue. */
Certainly dwarf2cfi can handle arbitrary REG_CFA_ADJUST_CFA notes;
it's just the frame_debug_expr state machine that gets confused.