This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][PR debug/83758] look more carefully for internal_arg_pointer in vt_add_function_parameter()
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Aaron Sawdey <acsawdey at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org, aolivia at gcc dot gnu dot org, boger at us dot ibm dot com, richard dot sandiford at linaro dot org, ebotcazou at adacore dot com, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>, ian at airs dot com
- Date: Mon, 29 Jan 2018 16:26:50 -0600
- Subject: Re: [PATCH][PR debug/83758] look more carefully for internal_arg_pointer in vt_add_function_parameter()
- Authentication-results: sourceware.org; auth=none
- References: <1517259670.4150.19.camel@linux.vnet.ibm.com> <20180129220529.GQ2063@tucnak>
On Mon, Jan 29, 2018 at 11:05:29PM +0100, Jakub Jelinek wrote:
> On Mon, Jan 29, 2018 at 03:01:10PM -0600, Aaron Sawdey wrote:
> > /* If there is a DRAP register or a pseudo in internal_arg_pointer,
> > rewrite the incoming location of parameters passed on the stack
> > into MEMs based on the argument pointer, so that incoming doesn't
> > depend on a pseudo. */
> > if (MEM_P (incoming)
> > && (XEXP (incoming, 0) == crtl->args.internal_arg_pointer
> > || (GET_CODE (XEXP (incoming, 0)) == PLUS
> > && XEXP (XEXP (incoming, 0), 0)
> > == crtl->args.internal_arg_pointer
> > && CONST_INT_P (XEXP (XEXP (incoming, 0), 1)))))
> > {
> > HOST_WIDE_INT off = -FIRST_PARM_OFFSET (current_function_decl);
> > if (GET_CODE (XEXP (incoming, 0)) == PLUS)
> > off += INTVAL (XEXP (XEXP (incoming, 0), 1));
> > incoming
> > = replace_equiv_address_nv (incoming,
> > plus_constant (Pmode,
> > arg_pointer_rtx, off));
> > }
>
> The code actually meant pointer comparison, the question is what is
> different on powerpc* that you end up with a different REG.
> >From what I can see, function.c uses crtl->args.internal_arg_pointer
> directly rather than a REG with the same REGNO.
> Where does it become something different and why?
There is a lot of code that copies any RTX that isn't obviously unique.
Here we have a PLUS of some things, which always needs copying, can
never be shared.
I agree internal_arg_pointer should be a register: documentation says so.
(Well actually it doesn't, there is no documentation for it, but the
next best thing, the header file where it is declared, says so).
But rs6000's implementation worked for years, maybe we shouldn't break
it now? Or maybe it is easy to fix. Or, does that restriction ("has
to be a pseudo or hard reg") actually buy us anything?
Segher