This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: alias and pointers analysis
- From: "J.C. Pizarro" <jcpiza at gmail dot com>
- To: "Diego Novillo" <dnovillo at google dot com>, gcc at gcc dot gnu dot org
- Date: Fri, 26 Oct 2007 07:18:13 +0200
- Subject: Re: alias and pointers analysis
On 10/26/07, Diego Novillo <dnovillo@google.com> wrote:
> SSA names of pointers are also pointers, when points-to sets are
> computed for SSA names, what you get is all the symbols that the
> particular SSA name has been found to point to. Eg,
>
> if (...)
> p_1 = &a;
> else
> p_2 = &b;
> endif
> p_3 = phi (p_1, p_2)
>
> points-to (p_1) = { a }
> points-to (p_2) = { b }
> points-to (p_3) = { a b }
What is the matter if the 'b' var. is unused and
optimally removed by the SSA algorithm?
int a;
int b;
a = 2;
p_4 = phi(a)
// b doesn't used here
if (...)
p_1 = &a;
else
p_2 = &b;
endif
p_3 = phi (p_1, p_2)
points-to (p_1) = { a }
points-to (p_2) = { b }
points-to (p_3) = { a b }
In this case, should exist hidden p_5 = phi(b) although 'b' is not used
but yes used his reference to phantom cell 'b'. It's weird for me.
I've not idea WHERE put "hidden p_5 = phi(b)"!
Too it's possible to ocurr *p_2 = c where 'b' will be hidden used through
the pointer p_2. It's too weird for me.
J.C. Pizarro