8-bit processors back-end optimizations

Bernd Schmidt crux@Pool.Informatik.RWTH-Aachen.DE
Mon Sep 1 02:46:00 GMT 1997


> 
> I have another question, while I'm at it...  When GCC notices that it has to spill
> things and puts stuff in stack slots: does it do any kind of effort to minimize the
> number of stack slots used (or in other words, does a stack slot get reused for
> multiple spills)?  I must admit the reload pass is rather obscure to me...
> In case there is currently no attempt to minimize stack space: some sort of
> stack slot allocation similar to register allocation might be nice for small
> targets with very limited amount of memory.

The answer is both yes and no. One of the first things reload does is
assign stack slots for all pseudos that could not be assigned to hard
registers during register allocation. It might be possible to share
slots among these (maybe using conflict information from global-alloc),
but there is currently no code to do that. On the other hand, when
reload needs to spill pseudos from a hard register, it will try to
re-use the same stack slot for all pseudos that previously were allocated
to the same hard register. That bit of code can be found in alter_reg()
in reload1.c.

Bernd



More information about the Gcc mailing list