This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: question about registers that are set on entry to a function.
- From: Jim Wilson <wilson at specifix dot com>
- To: Kenneth Zadeck <zadeck at naturalbridge dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC <gcc at gcc dot gnu dot org>, "Berlin, Daniel" <dberlin at dberlin dot org>
- Date: Wed, 08 Feb 2006 13:25:25 -0800
- Subject: Re: question about registers that are set on entry to a function.
- References: <43BD70E7.9030904@naturalbridge.com> <m3irsyz9cu.fsf@gossamer.airs.com> <43BD8CD4.8030704@naturalbridge.com> <m34q4iz7mz.fsf@gossamer.airs.com> <43BF20AC.3030206@naturalbridge.com>
Kenneth Zadeck wrote:
I have one question about EH_USES on the ia-64 (the only place it is
used).
I know this is a bit late, but I didn't see any answer to this on this
list, and figured you might still need one.
The IA-64 port uses EH_USES for registers that hold frame state. We can
optionally store some frame state in local registers in the current
register window. These are obviously live at the epilogue because the
epilogue code uses them. These are also live at EH edges, but this
isn't obvious because there are no explicit uses in the rtl. The uses
are hidden inside the unwind library. So EH_USES is used to make sure
these regs are live at entry to an EH edge. EH_USES serves the same
purpose as EPILOGUE_USES, except one is for EH edges and one is for
epilogues.
Why only IA-64 needs this, offhand, I don't know. Maybe it has to do
with the IA-64 unwinder that only IA-64 uses. Or maybe it has something
to do with how IA-64 register windows work. I don't care enough to take
a closer look.
These registers do not exist before the prologue/epilogue code is
emitted, and hence they do not exist before reload.
These are normal allocatable registers. If there are free registers,
then we use some of them for storing frame state. If there aren't any
free registers, then the frame state goes on the stack which is the
normal place for it. So there is no latent register allocation problem
here.
We only use 5 of 128 integer registers this way, so relatively speaking,
this isn't a lot of registers. Since these are local register windowed
regs, they are pretty cheap.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com