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: [Q:] Implementation of global register variables

On 14-Feb-2002, Fermin Reig <> 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 <>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

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