This is the mail archive of the
mailing list for the GCC project.
Re: Excess registers pushed - regs_ever_live not right way?
- From: Andrew Hutchinson <andrewhutchinson at cox dot net>
- To: "Seongbae Park (박성배, 朴成培)" <seongbae dot park at gmail dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Sat, 01 Mar 2008 12:07:24 -0500
- Subject: Re: Excess registers pushed - regs_ever_live not right way?
- References: <47C60B7A.email@example.com> <firstname.lastname@example.org> <47C6166B.email@example.com> <firstname.lastname@example.org>
I'm am still struggling with a good solution that avoids unneeded saves
of parameter registers.
To solve problem all I need to know are the registers actually used for
parameters. Since the caller assumes all of these are clobbered by
callee - they should never need to be saved.
DF_REG_DEF_COUNT is showing 1 artificial def for all POTENTIAL parameter
registers - not just the ones that are really used (since it uses target
FUNCTION_ARG_REGNO_P to get parameter registers)
So the DF artificial defs are useless in trying to find real parameter
That seem to require going over all DF chains to work out which
registers are externally defined. DF does not solve problem for me.
There has got to be an easier way of finding parameter registers used by
Seongbae Park (박성배, 朴成培) wrote:
> You can use DF_REG_DEF_COUNT() - if this is indeed a parameter register,
> there should be only one def (artificial def) or no def at all.
> Or if you want to see all defs for the reg,
> follow DF_REG_DEF_CHAIN().
> On Wed, Feb 27, 2008 at 6:03 PM, Andrew Hutchinson
> <email@example.com> wrote:
>> Register contains parameter that is passed to function. This register
>> is not part of call used set.
>> If this type of register were modified by function, then it would be
>> saved by function.
>> If this register is not modified by function, it should not be saved.
>> This is true even if function is not a leaf function (as same register
>> would be preserved by deeper calls)
>> Seongbae Park (박성배, 朴成培) wrote:
>> > On Wed, Feb 27, 2008 at 5:16 PM, Andrew Hutchinson
>> > <firstname.lastname@example.org> wrote:
>> >> Register saves by prolog (pushes) are typically made with reference to
>> >> "df_regs_ever_live_p()" or "regs_ever_live. "||
>> >> If my understanding is correct, these calls reflect register USEs and
>> >> not register DEFs. So if register is used in a function, but not
>> >> otherwise changed, it will get pushed unnecessarily on stack by prolog.
>> > This implies that the register is either a global register
>> > or a parameter register, in either case it won't be saved/restored
>> > as callee save.
>> > What kind of a register is it and how com there's only use of it in a function
>> > but it's not a global ?
>> > Seongbae