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

Re: [PATCH][PR debug/83758] look more carefully for internal_arg_pointer in vt_add_function_parameter()


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


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