This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [Q:] Implementation of global register variables
- From: Fergus Henderson <fjh at cs dot mu dot OZ dot AU>
- To: Fermin Reig <reig at ics dot uci dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 15 Feb 2002 16:49:17 +1100
- Subject: Re: [Q:] Implementation of global register variables
- References: <200202150219.g1F2JS201149@tenerife.ics.uci.edu>
On 14-Feb-2002, Fermin Reig <reig@ics.uci.edu> wrote:
> A straightforward way of implementing global register variables is by
> removing all registers that appear in global declarations from the
> pool of registers available to the allocator. Can someone confirm if
> this is how gcc does it?
Yes, that is how gcc does it.
There's a global array `fixed_regs' which records which registers
are not available for register allocation. globalize_reg()
in regclass.c, which gets called for global register variable
declarations, sets this. The register allocator avoids allocating
such registers.
This is an abbreviated description -- there's also a few other arrays and
HARD_REG_SETs which are used for related purposes (e.g. `global_regs',
`call_used_regs', `call_fixed_regs', and their corresponding HARD_REG_SETs
`fixed_reg_set', etc.). For full details, read the source ;-)
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.