This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/49088] Combine fails to properly handle zero-extension and signed int constant
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 May 2011 19:59:49 +0000
- Subject: [Bug rtl-optimization/49088] Combine fails to properly handle zero-extension and signed int constant
- Auto-submitted: auto-generated
- References: <bug-49088-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49088
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.20 19:42:51
Ever Confirmed|0 |1
--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-05-20 19:42:51 UTC ---
> 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.
RTL constants are always sign-extended for their mode but RTL objects,
including constants, have no specific signedness, except for a few exceptions
like the SUBREG_PROMOTED_UNSIGNED_P flag.
That being said, the transformation looks indeed invalid.