This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/28794] New: missed optimization with non COND_EXPR and vrp and comparisions
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Aug 2006 23:24:38 -0000
- Subject: [Bug tree-optimization/28794] New: missed optimization with non COND_EXPR and vrp and comparisions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int f(int x, int y)
{
int t;
for (t = 0; t < 50; t++)
g(t>0);
}
void f1(int x, int y)
{
int t;
for (t = 0; t < 50; t++)
g(t!=0);
}
--------------
The above two functions should produce the same code with f1 being better than
f.
If we change it to:
void f2(int x, int y)
{
int t;
for (t = 0; t < 50; t++)
{
int tt;
if (t>0)
tt = 1;
else
tt = 0;
g(tt);
}
}
-----
We get f1 so we are only folding comparisions in a COND_EXPR which is wrong, we
should also be doing them in MODIFY_EXPRs too.
--
Summary: missed optimization with non COND_EXPR and vrp and
comparisions
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28794