The following 2 functions should be compiled to the same assembly. 
This is one of Briggs' compiler benchmarks.

void motion_test2(int *data)
{
  int j;
  int i = 1;
  if (data[1]) {
    data[data[2]] = 2;
    j = data[0] + data[3];
    i = i + j;
  }
  data[4] = data[0] + data[3];
  data[5] = i;
}
void motion_result2(int *data)
{
  int j;
  int i = 1;
  if (data[1]) {
    data[data[2]] = 2;
    j = data[0] + data[3];
    i = i + j;
  }
  else
    j = data[0] + data[3];
  data[4] = j;
  data[5] = i;
}


-- 
           Summary: missed PRE
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dann at godzilla dot ics dot uci dot edu


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

Reply via email to