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: Questions about i386 redundant test and comparison removal



  In message <199806052349.TAA04390@jwlab.FEITH.COM>you write:
  > > What does SET_DEST (exp) have to do with setting cc0?
  > 
  > Okay, I think I've figured out part of the answer.  Recording
  > SET_DEST (exp) probably allows us to later notice that:
consider a machine where memory loads do not set cc0, but
an add or subtract does set them in some useful manner.

(set (regx) (plus ...))  Would record regx & the status bits that
			 are useful after a plus.

[ ... stuff that doesn't scrog cc0 ]
(set (regx) (load from memory)

(set (cc0) (regx))
conditional branch

If you don't track the SET_DESTs and invalidate known cc0 status
at the second set of regx, then you may end up deleting the
(set (cc0)) instruction even though it is not redundant.



jeff


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