If points-to sets for incoming pointers are properly pruned (see PR36201),
loadPRE no longer optimizes gcc.dg/tree-ssa/loadpre1[45].c which look like

  # VUSE <SMT.4_12(D)>
  d_3 = (*a_2(D))[0];
  if (argc_4(D) != 0)
    goto <bb 3>; 
  else 
    goto <bb 5>;

<bb 5>:
  goto <bb 4>; 

<bb 3>:

<bb 4>:
  # a_1 = PHI <a_2(D)(5), &c(3)>
  # VUSE <c_11, SMT.4_12(D)>
  e_6 = (*a_1)[0];

where we know that a_2(D) cannot point to c and thus the first load doesn't
alias c.  Without PR36201 fixed we got

  # VUSE <c_11, SMT.4_12(D)>
  d_3 = (*a_2(D))[0];
  if (argc_4(D) != 0)
    goto <bb 3>;
  else
    goto <bb 5>;

<bb 5>:
  goto <bb 4>;

<bb 3>:

<bb 4>:
  # a_1 = PHI <a_2(D)(5), &c(3)>
  # VUSE <c_11, SMT.4_12(D)>
  e_6 = (*a_1)[0];


and loadPRE did its job.


-- 
           Summary: load PRE doesn't deal with more precise alias info on
                    one path
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          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=36230

Reply via email to