This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14792] New: [tree-ssa] cast elimination opportunity involving an AND
- 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: 31 Mar 2004 02:55:14 -0000
- Subject: [Bug optimization/14792] New: [tree-ssa] cast elimination opportunity involving an AND
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
void bar (void);
void
foo (unsigned int a)
{
int b = a;
if (b & 1)
bar ();
}
I get:
foo (a)
{
int b;
_Bool T.1;
int T.0;
<bb 0>:
b_2 = (int)a_1;
T.0_3 = b_2 & 1;
T.1_4 = (_Bool)T.0_3;
if (T.1_4) goto <L0>; else goto <L1>;
<L0>:;
bar () [tail call];
<L1>:;
return;
}
We could skip "b" like so
T.0_3 = a_1 & 1;
--
Summary: [tree-ssa] cast elimination opportunity involving an AND
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: enhancement
Priority: P2
Component: 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=14792