This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How aggressive is CSE about removing redundant CC sets?
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 13 Feb 2004 21:55:15 -0500 (EST)
- Subject: 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