This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] reaching def. question
- From: Diego Novillo <dnovillo at redhat dot com>
- To: Devang Patel <dpatel at apple dot com>
- Cc: "gcc at gcc dot gnu dot org list" <gcc at gcc dot gnu dot org>
- Date: Tue, 16 Mar 2004 16:47:17 -0500
- Subject: Re: [tree-ssa] reaching def. question
- Organization: Red Hat Canada
- References: <642DFC88-7792-11D8-9053-000393A91CAA@apple.com>
On Tue, 2004-03-16 at 16:39, Devang Patel wrote:
> How do I find out reaching definitions of 'a' at statement S1?
>
> S1: a = b;
>
> What I want to know is whether S1 is defining 'a' first time
> or killing earlier def of 'a'. compute_reaching_defs () is not
> yet implemented. Is there any other alternative API?
>
compute_reaching_defs() wouldn't help you. There are no uses of 'a' in
S1.
You need to do a dominator walk and stop when you find the first
definition. But, there can be more than one:
if (...)
a = b;
else
a = c;
Both defs to 'a' are defininig 'a' for the "first time". Besides, in
our current framework. Every definition is a different variable.
What are you trying to solve?
Diego.