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]
Other format: [Raw text]

How aggressive is CSE about removing redundant CC sets?


Hi,

While converting h8300 port to MODE_CC, I encountered the following
sequence.

;; move r1 to r0, while testing r1
(parallel [(set (reg:SI 0 r0)
                (reg:SI 1 r1))
	   (set (reg:CC 12 cc)
                (compare:CC (reg:SI 1 r1)
			    (const_int 0)))])

;; test r1
(set (reg:CC 12 cc)
     (compare:CC (reg:SI 1 r1)
		 (const_int 0)))

;; jump depending on CC
(set (pc)
     (if_then_else (eq (reg:CC 12 cc)
		       (const_int 0))
		   (label_ref 17)
		   (pc)))

Note that the second insn isn't necessary because the first one does
the same as a side effect of the move insn.  With -O2, the first insn
didn't go away.  Does anybody know how aggressive CSE is about
removing redundant CC sets?

Thanks,

Kazu Hirata


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