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
> 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.
There will be as many definitions as there are predecessors of the block
that is the continuation of the loop.
What makes you think there will be more?
> So you would need to create phi nodes inside the function body and
> end up with standard ssa update algorithm anyway.
I disbelieve that you will end up creating phi nodes anywhere but the
block you've made the top of the loop.
>
> Zdenek
>
>