> On Mon, Mar 8, 2021 at 6:19 PM Eric Botcazou <botca...@adacore.com> wrote:
> >
> > Hi,
> >
> > this is a regression present on the mainline and 10 branch for architectures
> > that pass all structure types by reference, e.g. 32-bit PowerPC or SPARC.
> >
> > Jakub posted a detailed analysis in the audit trail and this boils down to
> > the RTL expander trying to take the address of a DECL whose RTX is a 
> > register.
> >
> > Bootstrapped/regtested on x86-64/Linux, PowerPC64/Linux and SPARC/Solaris,
> > OK for the mainline and 10 branch?
> 
> The whole point of thunks is that they do not require things like copying ... 
> is
> this case somehow IPA-SRA/CPed in an odd way?  Otherwise it seems like
> the passed through reference was mishandled on the GIMPLE level?
> 
> Honza?
So this is the case where call_from_thunk is true but we do not produce
tail call for some reason? For that it seems OK to me, just a missed
optimization since copy should be unnecesary.

So i guess the whole story is that we fail tailcall because we see
parameter that needs copying because we lose track of its original
memory location and only have value reloaded to register and we produce
non-tail call in thunk...

Honza
> 
> >
> > 2021-03-08  Eric Botcazou  <ebotca...@adacore.com>
> >
> >         PR C++/90448
> >         * calls.c (initialize_argument_information): When the argument
> >         is passed by reference, do not make a copy in a thunk only if
> >         the argument is already in memory.  Remove redundant test for
> >         the case of callee copy.
> >
> > --
> > Eric Botcazou

Reply via email to