This is the mail archive of the gcc@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: GCC hacking questions (peepholes etc.)



  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



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