static double inv_J(double a[][2])
{
  int i, j;
  double det = 0.0;
   for (j=0; j<2; ++j)
     det += a[j][0] + a[j][1];
  return det;
}

double foo()
{
  double mat[2][2];
  mat[0][0] = 0.0;
  mat[0][1] = 1.0;
  mat[1][0] = 2.0;
  mat[1][1] = 3.0;
  return inv_J(mat);
}

points-to computes D.1620_6 as points-to anything:

<bb 3>:
  D.1618_4 = (long unsigned int) j_3;
  D.1619_5 = D.1618_4 * 16;
  D.1620_6 = &mat + D.1619_5;
  # VUSE <mat_21, SMT.9_22(D)>
  D.1621_7 = (*D.1620_6)[0];
  D.1618_8 = (long unsigned int) j_3;
  D.1619_9 = D.1618_8 * 16;
  D.1620_10 = &mat + D.1619_9;
  # VUSE <mat_21, SMT.9_22(D)>
  D.1622_11 = (*D.1620_10)[1];
  D.1623_12 = D.1621_7 + D.1622_11;
  det_14 = D.1623_12 + det_13;
  j_15 = j_3 + 1;

because the constraints already say so:

D.1620_6 = ANYTHING


-- 
           Summary: points-to results imprecise
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, alias
          Severity: enhancement
          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=38049

Reply via email to