This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFH] Copyprop through aggregates
On Wed, 2006-01-25 at 16:57 +0100, Richard Guenther wrote:
> The problem seems to be this:
>
> Simulating block 6
>
> Visiting PHI node: iftmp.0_1 = PHI <iftmp.0_11(4), iftmp.0_7(5)>;
>
> Argument #1: iftmp.0_7 copy-of chain: iftmp.0_7 -> iftmp.0_7 [NOT
> A COPY]
>
> PHI node iftmp.0_1 copy-of chain: iftmp.0_1 -> iftmp.0_7 -> iftmp.0_7
> [COPY]
> Telling the propagator to add SSA edges out of this PHI and continue.
>
>
> which is wrong and we later revisit as
I wouldn't say it's wrong, it's just that initially we only have one
executable edge and thus we start with the assumption that the result
of the PHI will be equivalent to the argument associated with the one
executable edge.
> Simulating block 6
>
> Visiting PHI node: iftmp.0_1 = PHI <iftmp.0_11(4), iftmp.0_7(5)>;
>
> Argument #0: iftmp.0_11 copy-of chain: iftmp.0_11 -> iftmp.0_11
> [NOT A COPY]
> Argument #1: iftmp.0_7 copy-of chain: iftmp.0_7 -> iftmp.0_7 [NOT
> A COPY]
>
> PHI node iftmp.0_1 copy-of chain: iftmp.0_1 -> iftmp.0_1 [NOT A COPY]
> Telling the propagator to add SSA edges out of this PHI and never visit
> again.
Right.
> (but we used the wrong information already somehow).
Do you mean we already copy propagated iftmp.0_1 out of the IL?
That would be definitely wrong.
After visiting the PHI node the first time we had a copy and the
internal data structures in tree-ssa-copy.c should reflect that
iftmp.0_1 can be replaced with iftmp.0_7. However, the second time
those datastructures should have been updated since the PHI node
no longer represents a simple copy operation.
Jeff