This is the mail archive of the 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: Short Displacement Problems.

On May 30, 2002, Zack Weinberg <> 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
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist                Professional serial bug killer

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