This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa]: The dangers of keeping constants in phi nodes
- From: law at redhat dot com
- To: Daniel Berlin <dberlin at dberlin dot org>
- Cc: Diego Novillo <dnovillo at redhat dot com>, gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Mon, 05 Jan 2004 10:58:34 -0700
- Subject: Re: [tree-ssa]: The dangers of keeping constants in phi nodes
- Reply-to: law at redhat dot com
In message <814E9985-3F37-11D8-9460-000A95DA505C@dberlin.org>, Daniel Berlin wr
ites:
>
>On Jan 4, 2004, at 10:10 PM, Daniel Berlin wrote:
>
>> If you rewrite a var which had a constant propagated into a phi node,
>> it loses the phi node value (IE it never unpropagates it temporarily,
>> or remembers it was there), and thus, you lose the initialization.
>>
>> There is no warning that this occurred, and unless you noticed it
>> otherwise, it's not easy to catch.
>>
>> This is clearly a bug.
>
>Grrr.
>I never noticed that we can only rename *new* variables according to
>the API, so it's technically not a bug.
Use rewrite_vars_out_of_ssa to take the variable out of ssa form, then
use rewrite_into_ssa to put it back in SSA form.
[ The two interfaces into the rewriter need to be cleaned up so that there's
a single interface to avoid this kind of confusion. It's on my todo list. ]
Jeff