This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/27743] [4.1/4.2 Regression] Wrong code for ((unsigned) ((a) >> 2)) >> 15
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 May 2006 14:27:28 -0000
- Subject: [Bug middle-end/27743] [4.1/4.2 Regression] Wrong code for ((unsigned) ((a) >> 2)) >> 15
- References: <bug-27743-11275@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from rguenth at gcc dot gnu dot org 2006-05-23 14:27 -------
/* Turn (a OP c1) OP c2 into a OP (c1+c2). */
if (TREE_CODE (arg0) == code && host_integerp (arg1, false)
&& TREE_INT_CST_LOW (arg1) < TYPE_PRECISION (type)
&& host_integerp (TREE_OPERAND (arg0, 1), false)
&& TREE_INT_CST_LOW (TREE_OPERAND (arg0, 1)) < TYPE_PRECISION (type))
{
this should read TREE_CODE (op0) == code. Or
if (kind == tcc_comparison)
{
STRIP_SIGN_NOPS (arg0);
STRIP_SIGN_NOPS (arg1);
}
else
{
STRIP_NOPS (arg0);
STRIP_NOPS (arg1);
}
should use STRIP_SIGN_NOPS for arg0 and shifts.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27743