This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Short Displacement Problems.
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: "Naveen Sharma, Noida" <naveens at noida dot hcltech dot com>, Joern Rennecke <joern dot rennecke at superh dot com>, law at redhat dot com, bernds at redhat dot com, gniibe at m17n dot org, Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org
- Date: 31 May 2002 14:13:56 -0300
- Subject: Re: Short Displacement Problems.
- Organization: GCC Team, Red Hat
- References: <E04CF3F88ACBD5119EFE00508BBB212102DB5065@exch-01.noida.hcltech.com><20020530164053.GA16702@codesourcery.com>
On May 30, 2002, Zack Weinberg <zack@codesourcery.com> wrote:
> Only if we stick with the existing, lame, way of representing stack
> slots. (mem:MODE (plus:P (reg:P sp) (const_int offset))) is a pain to
> work with, yes. Consider (stack:MODE slot) instead -- with slot being
> akin to a pseudo-register number, and only one instance of any given
> stack RTX.
How is this different from plain pseudos? At some point, we have to
turn them into (mem (plus (reg sp) (const_int offset))), and reload is
probably the best point. It would be nice to defer the computation of
the offset, but optimizing that can be very tricky if you consider
that, by changing the location of a very commonly used pseudo to a
stack slot with a smaller offset, and moving whatever was in that
location to a stack slot with a larger offset, you end up needing more
registers to hold the address, so you have to spill them, but you
can't use yet another register to hold the spill address, so you
lose. This is just a simplified view of the complications.
> We could assign memory locations to these with just one linear scan
> over the RTL to replace them with MEM expressions at the end.
We already do this in reload, except we're replacing pseudos with mem
slots. We don't have to introduce one more scan, we just have to be
smarter as to which slots we assign to each pseudo.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer