http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51879

             Bug #: 51879
           Summary: Missed tail merging with non-const/pure calls
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ja...@gcc.gnu.org
                CC: vr...@gcc.gnu.org
        Depends on: 51877


We don't tail merge currently:
int bar (int);
void baz (int);

void
foo (int y)
{
  int a;
  if (y == 6)
    a = bar (7);
  else
    a = bar (7);
  baz (a);
}

(both before the PR51877 fix and after it), because both SSA_NAMEs on the lhs
of the calls aren't valueized the same by SCCVN.
Similarly for:
  if (y == 6)
    a = bar (7) + 6;
  else
    a = bar (7) + 6;
or
  if (y)
    baz (bar (7) + 6);
  else
    baz (bar (7) + 6);

Reply via email to