This is the mail archive of the gcc-patches@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]

Re: [patch] AVR disable peephole2 when not safe (interrupts)


On Thu, Dec 21, 2000 at 11:57:23AM -0800, Richard Henderson wrote:
> And it would hardly matter, since the number of stack slots
> reserved for said registers has already been fixed, and in 
> fact the instructions to save those registers have already
> been emitted.

I see.  So this "don't create an extra save/restore" is necessary for
correctness, not just for performance reasons?

> A more general representation for per-function call-clobbered
> register sets would be cool.

Yes.  It would also be nice to have a function attribute to specify
which registers are clobbered by a function - especially for simple
library subroutines (written in assembler) that only clobber some of
the call-used registers.

> You might be better off with a function that verifies that
> any _particular_ chosen scratch is safe and FAILing the 
> peephole if not.

How to do this?  The condition of define_peephole2 is checked before
the scratch is allocated, so avr_peep2_scratch_safe (operands[3])
doesn't work as the condition (I tried that first).

Thanks,
Marek

PS.  Merry Christmas and Happy New Year.


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