This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/24418] Redudant compare to zero not eliminated
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2005 00:10:00 -0000
- Subject: [Bug rtl-optimization/24418] Redudant compare to zero not eliminated
- References: <bug-24418-11457@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pinskia at gcc dot gnu dot org 2005-10-18 00:09 -------
and yes eax/reg 68 (or n) is dead after the compare in combine:
(insn 37 36 39 3 (parallel [
(set (reg/v:SI 68 [ n ])
(minus:SI (reg:SI 71)
(reg/v:SI 66 [ med ])))
(clobber (reg:CC 17 flags))
]) 172 {*subsi_1} (insn_list:REG_DEP_TRUE 36 (nil))
(expr_list:REG_DEAD (reg:SI 71)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 39 37 40 3 (set (reg:CC 17 flags)
(compare:CC (reg/v:SI 68 [ n ])
(const_int 0 [0x0]))) 2 {*cmpsi_1_insn} (insn_list:REG_DEP_TRUE 37
(nil))
(expr_list:REG_DEAD (reg/v:SI 68 [ n ])
(nil)))
Note the REG_DEAD, so what RTH said is wrong.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24418