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

--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 28 Sep 2020, amonakov at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97194
> 
> --- Comment #9 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
> (In reply to Richard Biener from comment #8)
> > Note that currently RTL expansion forces a local vector typed variable
> > to the stack (instead of allocating a pseudo) when there are
> > variable-index accesses to it.  That might be a reason to also handle
> > slightly "expensive" extract cases.  But I guess later falling back
> > to a stack slot via a splitter or LRA will lead to worse code.
> 
> Indeed, but I struggle to see a good reason to bind the entire lifetime of a
> variable to memory just because one operation requires that. Cannot GCC 
> instead
> create a fresh temporary early at RTL-expand (not split) time for each extract
> operation, letting the original variable live in a pseudo, and binding only
> that short-lived temporary to memory?
> 
> It can result in extra copies if the temporary needs to be loaded from memory
> anyway, but I think passes like RTL CSE should be able to propagate them.

Sure, that would be possible.  We do this kind of things for
CONCAT (complex numbers) with handling some select cases and falling
back to spilling.  But we've backed off for more general handling
because it ICEd too many cases.

For inserts we don't want to do this since I'm quite positive that
RTL wouldn't be able to merge two spill slots when doing two
consecutive inserts.

Reply via email to