This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] AVR disable peephole2 when not safe (interrupts)
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: [patch] AVR disable peephole2 when not safe (interrupts)
- From: Marek Michalkiewicz <marekm at linux dot org dot pl>
- Date: Sat, 23 Dec 2000 12:48:21 +0100
- Cc: denisc at overta dot ru, gcc-patches at gcc dot gnu dot org, marekm at linux dot org dot pl
- References: <200012211941.UAA21495@marekm.home> <20001221115723.D22700@redhat.com>
- Reply-To: marekm at linux dot org dot pl
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.