This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/64682] [5 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Jan 2015 12:32:17 +0000
- Subject: [Bug rtl-optimization/64682] [5 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
- Auto-submitted: auto-generated
- References: <bug-64682-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64682
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, so the thing is probably that:
(insn 28 27 29 7 (parallel [
(set (reg:SI 102)
(udiv:SI (reg:SI 100)
(reg:SI 90 [ D.1884 ])))
(set (reg:SI 101 [ D.1886 ])
(umod:SI (reg:SI 100)
(reg:SI 90 [ D.1884 ])))
(clobber (reg:CC 17 flags))
]) pr64682.c:21 351 {*udivmodsi4}
(expr_list:REG_DEAD (reg:SI 100)
(expr_list:REG_DEAD (reg:SI 90 [ D.1884 ])
(expr_list:REG_UNUSED (reg:SI 102)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))))
(insn 29 28 30 7 (parallel [
(set (reg:SI 90 [ D.1884 ])
(ior:SI (reg:SI 101 [ D.1886 ])
(const_int 5 [0x5])))
(clobber (reg:CC 17 flags))
]) pr64682.c:21 398 {*iorsi_1}
(expr_list:REG_DEAD (reg:SI 101 [ D.1886 ])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 30 29 31 7 (set (mem/c:SI (symbol_ref:DI ("b") [flags 0x2] <var_decl
0x7ffff1867cf0 b>) [1 b+0 S4 A32])
(reg:SI 90 [ D.1884 ])) pr64682.c:21 90 {*movsi_internal}
(nil))
we combine these 3 into:
(note 28 27 29 7 NOTE_INSN_DELETED)
(insn 29 28 30 7 (set (reg:SI 90 [ D.1884 ])
(const_int 5 [0x5])) pr64682.c:21 90 {*movsi_internal}
(nil))
(insn 30 29 31 7 (set (mem/c:SI (symbol_ref:DI ("b") [flags 0x2] <var_decl
0x7ffff1867cf0 b>) [1 b+0 S4 A32])
(const_int 5 [0x5])) pr64682.c:21 90 {*movsi_internal}
(nil))
and then try to distribute notes, and as there was a REG_DEAD note for pseudo
90 (correct IMHO) in insn 28, but insn 29 set it again to something else, when
we try to distribute the REG_DEAD note onto the new insn 29 (or 30), we delete
insn 29 as dead. Giving up, not familiar enough with the dead note
distribution in the combiner.