This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Is regs_ever_live valid in prologue? (SPARC quirk?)
- From: Jim Wilson <wilson at redhat dot com>
- To: "Antonio Cunei" <ack at cunei dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: 29 Apr 2002 18:53:19 -0400
- Subject: Re: Is regs_ever_live valid in prologue? (SPARC quirk?)
- References: <E171GP6-0000ma-00@rev.vosn.net>
>int incorrect(int a,int b)
>{
> return b-a-b-a;
>}
Gcc optimizes this to "0-a-a". Since b is not used in the function,
%o1 is never live. This allows us to use %o1 for register allocation,
if we needed that register.
Someone would have to debug gcc to figure out why %i1 is being used.
The use of %i1 is perhaps an accident of implementation. Gcc sometimes
loses track of whether a pseudo register is needed or not (REG_N_SETS is
inaccurately updated by some optimization passes), and in that case we
will allocate a register that we don't need. This is pretty harmless in
most cases.
Jim