This is the mail archive of the gcc@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]

Re: tree-SSA and indirect references.


On Tue, Jan 20, 2004 at 08:57:24AM -0800, Andrew Pinski wrote:
> There is also PR 8781 which has the same exact problem and it is 
> shorter.

This is a different problem.  There are no casts involved.
After SRA and DCE, we have

  pred<D1926> = f;
  pred<D1933>.pred = &pred<D1926>;
  pred<D1940>.pred = &pred<D1933>;
  pred<D1947>.pred = &pred<D1940>;
  pred<D1954>.pred = &pred<D1947>;
  pred<D1961>.pred = &pred<D1954>;
  pred<D1968>.pred = &pred<D1961>;
  pred<D1975>.pred = &pred<D1968>;
  pred<D1982>.pred = &pred<D1975>;
  T.1<D2040>_54 = pred<D1933>.pred;
  T.2<D2041>_55 = *T.1<D2040>_54;
  T.3<D2042>_56 = T.2_55 ();

We don't get f propagated to T.2<D2041>_55 because (1) SRA doesn't
work on structures whose address is taken, and (2) we don't have
even *simplistic* propagation of field values for addressed structs.
Point the second is criminal.

The reason we don't delete 

  pred<D1940>.pred = &pred<D1933>;
  pred<D1947>.pred = &pred<D1940>;
  pred<D1954>.pred = &pred<D1947>;
  pred<D1961>.pred = &pred<D1954>;
  pred<D1968>.pred = &pred<D1961>;
  pred<D1975>.pred = &pred<D1968>;
  pred<D1982>.pred = &pred<D1975>;

is that we think that these objects have all have their address
taken, and thus might be referenced by the function call.  There
was one more iteration on the end that DCE removed, so in theory
repeated applications of DCE would clean this up.  However, I 
think the most dramatic improvement would be escape analysis.
None of the addresses in the chain is stored in globally accessible
memory, and thus the function call can't reference any of the
addresses, and thus they are all dead.


r~


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