This is the mail archive of the gcc@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]

Aarch64 implementation for dwarf exception handling


Hi,

I have a question about the implementation of

aarch64_final_eh_return_addr

which is used to point out the return address of the frame

According the source code

If FP is not needed

  return gen_frame_mem (DImode,
                        plus_constant (Pmode,
                                       stack_pointer_rtx,
                                       fp_offset
                                       + cfun->machine->frame.saved_regs_size
                                       - 2 * UNITS_PER_WORD));


According the frame layout

        +-------------------------------+ <-- arg_pointer_rtx
        |
        |  callee-allocated save area
        |  for register varargs
        |
        +-------------------------------+
        |
        |  local variables
        |
        +-------------------------------+ <-- frame_pointer_rtx
        |
        |  callee-saved registers
        |
        +-------------------------------+
        |  LR'
        +-------------------------------+
        |  FP'
       P+-------------------------------+ <-- hard_frame_pointer_rtx
        |  dynamic allocation
        +-------------------------------+
        |
        |  outgoing stack arguments
        |
        +-------------------------------+ <-- stack_pointer_rtx

Shouldn't the return value be

  return gen_frame_mem (DImode,
                        plus_constant (Pmode,
                                       stack_pointer_rtx,
                                       fp_offset
                                       +  2* UNITS_PER_WORD));

Or I just mis-understanding something ?


Hope someone could give me a tip.

It would be very helpful.

Thanks

Shiva Chen


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