This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15547] New: [tree-ssa] don't generate if (a != 0) for if (a)
- From: "dann at godzilla dot ics dot uci dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2004 23:55:19 -0000
- Subject: [Bug tree-optimization/15547] New: [tree-ssa] don't generate if (a != 0) for if (a)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For the function
int foo (int a)
{
if (a) return 1;
else return 0;
}
the .original dump is:
{
if (a != 0)
return <return-value> = 1;
else
return <return-value> = 0;
}
It is more space efficient to translate the "if" to "if (a) "
It might even be a good idea to fold if (a != 0) to if (a) during optimization.
--
Summary: [tree-ssa] don't generate if (a != 0) for if (a)
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dann at godzilla dot ics dot uci dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15547