This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Excess registers pushed - regs_ever_live not right way?
- From: "Seongbae Park (박성배, 朴成培)" <seongbae dot park at gmail dot com>
- To: "Andrew Hutchinson" <andrewhutchinson at cox dot net>
- Cc: "GCC Development" <gcc at gcc dot gnu dot org>
- Date: Sat, 1 Mar 2008 13:48:19 -0800
- Subject: Re: Excess registers pushed - regs_ever_live not right way?
- References: <47C60B7A.5010809@cox.net> <ab3a61990802271752s2d652c30p77e767d2d9ab8214@mail.gmail.com> <47C6166B.6030806@cox.net> <ab3a61990802271818me994abybeb1eb647a386cf0@mail.gmail.com> <47C98D4C.8020307@cox.net>
2008/3/1 Andrew Hutchinson <andrewhutchinson@cox.net>:
> 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.
I'm totally confused what is the problem here.
I thought you were seeing extra callee-save register save/restore in prologue,
but now it sounds like you're seeing extra caller-save register save/restore.
Which one are you trying to solve, and what kind of target is this ?
> 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)
You said you wanted to know if there's a def of a register within a function.
For an incoming parameter, there will be one artificial def,
and if there's no other def, it means there's no real def
of the register within the function.
> So the DF artificial defs are useless in trying to find real parameter
> registers.
I don't understand what you mean by this. What do you mean by
"real parameter register" ?
> That seem to require going over all DF chains to work out which
> registers are externally defined. DF does not solve problem for me.
What do you mean by "externally defined" ?
DF may not solve the problem for you,
but now I'm completely lost on what your problem is.
> There has got to be an easier way of finding parameter registers used by
> function.
If you want to find all the uses (use as in reading a register but not
writing to it),
you should look at USE chain, not DEF chain, naturally.
Seongbae