This is the mail archive of the gcc-bugs@gcc.gnu.org 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: Is regs_ever_live valid in prologue? (SPARC quirk?)


>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


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