This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC hacking questions (peepholes etc.)
- To: Marek Michalkiewicz <marekm at linux dot org dot pl>
- Subject: Re: GCC hacking questions (peepholes etc.)
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Wed, 26 Jul 2000 10:54:04 -0600
- cc: gcc at gcc dot gnu dot org
- Reply-To: law at cygnus dot com
In message <200007260709.JAA08151@marekm.home>you write:
> - is it allowed to mix both define_peephole and define_peephole2 in
> one md file?
I believe so. However, define_peephole2 is a much better construct to use.
> into various strange bugs if I do it: operands that don't satisfy
> HARD_REGNO_MODE_OK resulting in invalid asm output, abort() in
> insn-extract.c, segfault in final.c cleanup_subreg_operands() etc.
> (If I use -fno-peephole, or remove all define_peephole2 added,
> everything is stable again; but just making the conditions of all
> define_peephole2 always 0 doesn't help - this means I can't make
> the unsafe changes optional, enabled with -m...)
Sounds like a bug in your peephole2.
> - if the answer to the above is "no", is it possible for define_peephole
> to request a scratch register (as documented for define_peephole2)?
Nope. The ability to get a scratch register was one of the main
motivations for define_peephole2 in the first place.
jeff