This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [avr] gas support for cfi info
On 02/22/2011 08:17 AM, Anitha Boyapati wrote:
> Just to be on same page, these are the 2 places:
>
> 1. gen_enable_interrupt()
> 2. gen_call_prologue_saves()
>
>
> For the latter, can you explain why adding reg notes is required?
>
> + add_reg_note (insn, REG_CFA_ADJUST_CFA,
> + gen_rtx_SET (VOIDmode,
> + (frame_pointer_needed
> + ? frame_pointer_rtx : stack_pointer_rtx),
> + plus_constant (stack_pointer_rtx,
> + -(size + live_seq))));
> +
>
> (The comment does say that this is to describe the effect of
> UNSPEC_VOLATILE, but how reg notes help?)
The external function call represented by the prologue_saves unspec
saves registers to the stack, and allocates stack space. Both of
these actions are things we want to describe in unwind info. The
reg notes I added describe all of the actions performed by the
function call.
>> (2) At present it's possible to use epilogue_restores without
>> having used prologue_saves. I.e. use epilogue_restores with
>> an inline prologue. The problem being that the inline prologue
>> uses an HImode push of REG_Y (i.e. r29 first), whereas the code
>> in prologue_saves pushes r28 first and epilogue_restores is
>> written to expect that.
>>
>
> Is this is the line being referred to ?
>
> if (frame_pointer_needed)
> {
> ...
> /* Push frame pointer. */
> insn = emit_move_insn (pushword, frame_pointer_rtx);
Yes.
r~