This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Fix latent bug in tailcall
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Diego Novillo <dnovillo at redhat dot com>
- Date: Tue, 31 Jan 2006 23:27:35 +0100
- Subject: Re: [PATCH]: Fix latent bug in tailcall
- References: <43DFB823.2040002@dberlin.org>
Hello,
> Daniel Berlin wrote:
> > This patch fixes a latent bug in tree-tailcall where it did not update
> > the virtual ssa form for non-call clobbered virtual operands, even when
> > there were live on entry virtual operands that needed updating.
>
> Just to be thorough for Diego (and the list)'s, you *could* do this
> without calling update_ssa, but the algorithm used is the same:
>
> For each virtual definition that has a live on entry operand
> 1. Find the definition that will now reach the entry block
> and a dd this definition as a phi argument.
> 2. Add the live on entry definition as the other phi argument
> 3. Replace all uses to use the phi node.
>
> I tried implementing this, and it ends up being no faster than calling
> the virtuals-only update, so ......
the additional problem with this algorithm is that it does not work --
in particular in step 1, such definition does not have to be unique.
So you would need to create phi nodes inside the function body and
end up with standard ssa update algorithm anyway.
Zdenek