This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Mar 2005 18:30:57 -0000
- Subject: [Bug target/20322] [4.0/4.1 Regression] Miscompilation of libcpp/expr.c at -O2+
- References: <20050304175009.20322.jakub@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jakub at gcc dot gnu dot org 2005-03-04 18:30 -------
>From initial skimming, this sounds like combiner bug.
(insn 78 41 79 0 (set (reg:CC 17 flags)
(compare:CC (reg:DI 58 [ e$b.9 ])
(reg:DI 59 [ e$b.8 ]))) 2 {cmpdi_1_insn_rex64}
(insn_list:REG_DEP_TRUE 41 (nil))
(expr_list:REG_DEAD (reg:DI 59 [ e$b.8 ])
(nil)))
(insn 79 78 52 0 (parallel [
(set (reg:DI 64 [ e$a ])
(plus:DI (plus:DI (ltu:DI (reg:CC 17 flags)
(const_int 0 [0x0]))
(reg:DI 64 [ e$a ]))
(const_int 0 [0x0])))
(clobber (reg:CC 17 flags))
]) 174 {adddi3_carry_rex64} (insn_list:REG_DEP_TRUE 77
(insn_list:REG_DEP_TRUE 78 (nil)))
(expr_list:REG_DEAD (reg:CC 17 flags)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 52 79 53 0 (parallel [
(set (reg:DI 76)
(lshiftrt:DI (reg:DI 61 [ f$0 ])
(const_int 32 [0x20])))
(clobber (reg:CC 17 flags))
]) 435 {*lshrdi3_1_rex64} (nil)
(expr_list:REG_DEAD (reg:DI 61 [ f$0 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 53 52 55 0 (parallel [
(set (reg:DI 60 [ e$a.6 ])
(plus:DI (reg:DI 64 [ e$a ])
(reg:DI 76)))
(clobber (reg:CC 17 flags))
]) 192 {*adddi_1_rex64} (insn_list:REG_DEP_TRUE 79
(insn_list:REG_DEP_TRUE 52 (nil)))
(expr_list:REG_DEAD (reg:DI 64 [ e$a ])
(expr_list:REG_DEAD (reg:DI 76)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))))
before combine is turned into:
(insn 78 41 79 0 (set (reg:CC 17 flags)
(compare:CC (reg:DI 58 [ e$b.9 ])
(reg:DI 59 [ e$b.8 ]))) 2 {cmpdi_1_insn_rex64}
(insn_list:REG_DEP_TRUE 41 (nil))
(expr_list:REG_DEAD (reg:DI 59 [ e$b.8 ])
(nil)))
(note 79 78 52 0 NOTE_INSN_DELETED)
(insn 52 79 53 0 (parallel [
(set (reg:DI 76)
(lshiftrt:DI (reg:DI 61 [ f$0 ])
(const_int 32 [0x20])))
(clobber (reg:CC 17 flags))
]) 435 {*lshrdi3_1_rex64} (nil)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 61 [ f$0 ])
(nil))))
(insn 53 52 55 0 (parallel [
(set (reg:DI 60 [ e$a.6 ])
(plus:DI (plus:DI (ltu:DI (reg:CC 17 flags)
(const_int 0 [0x0]))
(reg:DI 64 [ e$a ]))
(reg:DI 76)))
(clobber (reg:CC 17 flags))
]) 174 {adddi3_carry_rex64} (insn_list:REG_DEP_TRUE 77
(insn_list:REG_DEP_TRUE 52 (nil)))
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 76)
(expr_list:REG_DEAD (reg:DI 64 [ e$a ])
(nil)))))
which shouldn't be done, because the middle instruction is kept and clobbers
(reg:CC 17 flags), so combiner can't move use of %eflags from the first to the
last insn accross the clobber.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20322