This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/49088] New: Combine fails to properly handle zero-extension and signed int constant
- From: "hjl.tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 May 2011 17:24:25 +0000
- Subject: [Bug rtl-optimization/49088] New: Combine fails to properly handle zero-extension and signed int constant
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49088
Summary: Combine fails to properly handle zero-extension and
signed int constant
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: hjl.tools@gmail.com
CC: ebotcazou@gcc.gnu.org
We have
(insn 5 2 7 2 (parallel [
(set (reg/f:DI 61)
(plus:DI (reg/f:DI 20 frame)
(const_int -64 [0xffffffffffffffc0])))
(clobber (reg:CC 17 flags))
]) x.i:12 252 {*adddi_1}
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil)))
(insn 17 9 18 2 (parallel [
(set (reg:SI 72)
(plus:SI (subreg:SI (reg/f:DI 61) 0)
(const_int 6 [0x6])))
(clobber (reg:CC 17 flags))
]) x.i:14 251 {*addsi_1}
(expr_list:REG_DEAD (reg/f:DI 61)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
(insn 18 17 10 2 (set (reg:DI 73)
(zero_extend:DI (reg:SI 72))) x.i:14 112 {*zero_extendsidi2_rex64}
(expr_list:REG_DEAD (reg:SI 72)
(nil)))
(insn 11 10 12 2 (set (reg:DI 68)
(reg:DI 73)) x.i:14 62 {*movdi_internal_rex64}
(expr_list:REG_DEAD (reg:DI 73)
(nil)))
combine turns it into
(insn 18 17 10 2 (set (reg:DI 73)
(const_int 4294967238 [0xffffffc6])) x.i:14 62 {*movdi_internal_rex64}
(nil))
(insn 11 10 12 2 (set (reg:DI 68)
(plus:DI (reg/f:DI 20 frame)
(reg:DI 73))) x.i:14 247 {*lea_1}
(expr_list:REG_DEAD (reg:DI 73)
(nil)))
"const_int -64" is signed, not unsigned.