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: PPro patch for egcs



  In message <199806052058.QAA03893@jwlab.FEITH.COM>you write:
  > >   > Does final.c only remove tests / comparisons against zero?
  > > Nope.  It can remove any instruction that sets cc0.
  > 
  > So can the following (contrived) code
  > 
  >   set a = 6
  >   set b = 5
  >   set c = MINUS a  b   sets CC_NO_OVERFLOW
  > 
  >   set cc0 = COMPARE a b
  >   set d IF_THEN_ELSE GE ...
  > 
  > get turned into
  > 
  >   set a = 6
  >   set b = 5
  >   set c = MINUS a  b   sets CC_NO_OVERFLOW
  > 
  >   set d IF_THEN_ELSE GE ...
It can if the port is set up to allow such optimizations.

However, most ports only handle removal of "tst" insns (compares
against zero).  I don't know what the x86 port is set up to optimize.

Jeff

PS. A "tst" insn looks like  (set (cc0) (reg/mem))



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