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/51030] New: PHI opt does not handle value-replacement with a transfer function


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

             Bug #: 51030
           Summary: PHI opt does not handle value-replacement with a
                    transfer function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


int f(int i)
{
  if (i)
    return i+2;
  return 2;
}

struct C { int i; };
int *g(struct C *p)
{
  if (p)
    return &p->i;
  return (int *)0;
}

both cases can be optimized to return i + 2 or &p->i, respectively.
Currently it only handles

int f(int i)
{
  if (i != 1)
    return i;
  return 1;
}


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