On Tue, Jan 30, 2018 at 03:55:58AM -0600, Segher Boessenkool wrote:
> > But in that case, what does the copying?
> 
> I don't know.  Aaron will look at it, but timezones etc. :-)
> 
> > That's what seems strange.  I can see why we'd have two nested
> > pluses with the inner plus being pointer-equal to internal_arg_ptr.
> > And I can see why we'd have a single canonical plus (which IMO would
> > be better, but I agree it's not stage 4 material).  It's having the two
> > nested pluses without maintaining pointer equality that seems strange.
> 
> The inner plus is *not* pointer-equal, that is the problem.  Something
> did copy_rtx (or such) on it, many things do.  We can tell you what
> exactly later today.

Most likely unshare_all_rtl, which does:
  for (tree decl = DECL_ARGUMENTS (cfun->decl); decl; decl = DECL_CHAIN (decl))
    {
      if (DECL_RTL_SET_P (decl))
        SET_DECL_RTL (decl, copy_rtx_if_shared (DECL_RTL (decl)));
      DECL_INCOMING_RTL (decl) = copy_rtx_if_shared (DECL_INCOMING_RTL (decl));
    }

Anyway, my preference would be to change that gen_rtx_PLUS into
  stack_parm = crtl->args.internal_arg_pointer;
  if (!CONST_INT_P (offset_rtx))
    stack_parm = gen_rtx_PLUS (Pmode, stack_parm, offset_rtx);
  else if (offset_rtx != const0_rtx)
    stack_parm = plus_constant (Pmode, stack_parm, INTVAL (offset_rtx));
  stack_parm = gen_rtx_MEM (data->promoted_mode, stack_parm);
and deal specially with GET_CODE (crtl->args.internal_arg_pointer)
in var-tracking.c.
rs6000/powerpcspe with -fsplit-stack are the only cases where
crtl->args.internal_arg_pointer is not a REG, so just running libgo
testsuite on powerpc{,64,64le} should cover it all.

        Jakub

Reply via email to