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


On Monday, November 25, 2002, at 01:25  PM, Aldy Hernandez wrote:

Howdy all.

Here is a preliminary patch for copy-propagation on trees.

In talking with Diego, we have found one big problem, which is:

   a = y;
   y = z;
   if (a)
      blah;

Under the current infrastructure, we'd propagate a=y on if(a) which is
wrong because Y has been killed after the definition of A.
Which gives you A few simple options:
1.Use a combination of dominator info (if the two refs are in different BB's) and linear backwards walks (see if you hit a redefinition of y between the target and the source) to determine if it's safe.
2. Introduce a temporary for just these special cases (IE when you have a redefinition(.
Kinda defeats the purpose of copy-prop.
3. Don't copy-prop these.


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