https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24943

--- Comment #11 from dave.anglin at bell dot net ---
On 2019-03-13 4:09 a.m., rguenth at gcc dot gnu.org wrote:
> So it's a target issue, not a debug one.  Of course we could avoid generating
> wrong-debug by generating none whenever the argument pointer is involved?
It appears to me that this is likely a generic target problem:

rtx
default_internal_arg_pointer (void)
{
  /* If the reg that the virtual arg pointer will be translated into is
     not a fixed reg or is the stack pointer, make a copy of the virtual
     arg pointer, and address parms via the copy.  The frame pointer is
     considered fixed even though it is not marked as such.  */
  if ((ARG_POINTER_REGNUM == STACK_POINTER_REGNUM
       || ! (fixed_regs[ARG_POINTER_REGNUM]
             || ARG_POINTER_REGNUM == FRAME_POINTER_REGNUM)))
    return copy_to_reg (virtual_incoming_args_rtx);
  else
    return virtual_incoming_args_rtx;
}

static rtx
pa_internal_arg_pointer (void)
{
  /* The argument pointer and the hard frame pointer are the same in
     the 32-bit runtime, so we don't need a copy.  */
  if (TARGET_64BIT)
    return copy_to_reg (virtual_incoming_args_rtx);
  else
    return virtual_incoming_args_rtx;
}

Both routines use copy_to_reg.

Reply via email to