This is the mail archive of the gcc@gcc.gnu.org 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: discouraging register use


DJ Delorie <dj@redhat.com> writes:

> Ok, I'm working on this chip that has a small number of cheap
> registers, and a large number of expensive ones (they exist in memory
> but the chip treats them like registers).  What is the preferred (aka
> "right") way of telling gcc to prefer the cheap registers?

If the expensive registers appear in REG_ALLOC_ORDER and if
HARD_REGNO_MODE_OK indicates that they can hold the relevant modes,
then I suspect that there is pretty much no way to stop gcc from using
them.  As soon as gcc has used all the cheap registers for something,
however trivial, it will start using the expensive registers.

You might want to try leaving the expensive registers out of
REG_ALLOC_ORDER.  Then try hacking alter_reg() to try to spill cheap
registers into expensive registers before spilling them into memory.

Ian


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