struct Loc {
  int x[3];
};

int foo (int i, int j, int k, int b)
{
  struct Loc IND;

  if (b)
    {
      IND.x[0] = i;
      IND.x[1] = j;
      IND.x[2] = k-1;
    }
  else
    {
      IND.x[0] = i;
      IND.x[1] = j;
      IND.x[2] = k;
    }

  return IND.x[0] + IND.x[1] + IND.x[2];
}

used to be optimized to operations on only the scalars i, j and k.


-- 
           Summary: [4.4 Regression] load-PRE missed opportunities without
                    SFTs
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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

Reply via email to