This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/28868] New: Not elimintation the PHIs which have the same agruments
- 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: 28 Aug 2006 05:52:52 -0000
- Subject: [Bug tree-optimization/28868] New: Not elimintation the PHIs which have the same agruments
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
These two functions should produce the same asm but they don't:
int f(int t, int a, int b)
{
int c, d;
if (t)
{
c = a;
d = a;
}
else
{
c = b;
d = b;
}
return c+d;
}
int f1(int t, int a, int b)
{
int c;
c = t?a:b;
return c+c;
}
----------------
f1 is better optimized because it has less register pressure than f.
Note this was reduced from a problem in PR23305.
--
Summary: Not elimintation the PHIs which have the same agruments
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
OtherBugsDependingO 23305
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28868