This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/52345] New: Missed optimization dealing with bools
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Feb 2012 21:43:58 +0000
- Subject: [Bug tree-optimization/52345] New: Missed optimization dealing with bools
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52345
Bug #: 52345
Summary: Missed optimization dealing with bools
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pinskia@gcc.gnu.org
Take the following three functions:
int f(int a, int b)
{
int c = a != 0;
int d = (c!=0|b!=0);
return d;
}
int f1(int a, int b)
{
int c = a != 0;
int e = c!=0;
int h = b!=0;
int d = e|h;
return d;
}
int f2(int a, int b)
{
return (a!=0|b!=0);
}
--- CUT ---
Right now only f2 produces good code while the other two are not so good.