This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/21137] New: Convert (a >> 2) & 1 != 0 into a & 4 != 0
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Apr 2005 00:47:03 -0000
- Subject: [Bug tree-optimization/21137] New: Convert (a >> 2) & 1 != 0 into a & 4 != 0
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
At tree level, we would like to canonicalize (a >> 2) & 1 != 0 into a & 4 != 0.
Currently,
void bar (void);
void
foo (int a)
{
if ((a >> 2) & 1)
bar ();
}
turns into
foo (a)
{
int D.1235;
int D.1236;
_Bool D.1237;
D.1235 = a >> 2;
D.1236 = D.1235 & 1;
D.1237 = (_Bool) D.1236;
if (D.1237)
{
bar ();
}
else
{
}
}
--
Summary: Convert (a >> 2) & 1 != 0 into a & 4 != 0
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21137