This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/28868] New: Not elimintation the PHIs which have the same agruments


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]