Is regs_ever_live valid in prologue? (SPARC quirk?)
Jim Wilson
wilson@redhat.com
Mon Apr 29 17:36:00 GMT 2002
>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
More information about the Gcc-bugs
mailing list