This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using Alias analysis
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: drizzle drizzle <drizzle76 at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 11 Nov 2005 14:46:31 -0500
- Subject: Re: Using Alias analysis
- References: <7326d8e40511111132re27e745rcb37688a08035afa@mail.gmail.com> <7326d8e40511111133p65331c94m61c4a7ef31c25902@mail.gmail.com>
On Fri, 2005-11-11 at 19:33 +0000, drizzle drizzle wrote:
> Hi .
> I want to use gcc's alias analysis in a standalone way. What I
> observe is that a lot of the information is hidden because of
> additional temporaries that have been generated. Can any one suggest
> as to if there is a simple workaround to this ?
>
> To illustrate what I am saying
>
> for a stmt
> heap_ptr= (int**) malloc the alias analysis tells me D.1072 points to
> malloc and heap_ptr points to anything
You shouldn't see this, and in fact, i don't.
#include <string.h>
int
main ()
{
int **fooptr;
fooptr = (int **)malloc (sizeof (int *));
return 0;
}
gives
main ()
{
intD.0 * * fooptrD.1403;
intD.0 D.1405;
voidD.28 * D.1404;
# BLOCK 0
# PRED: ENTRY (fallthru)
# HEAP.5D.1417_6 = V_MAY_DEF <HEAP.5D.1417_5>;
D.1404_1 = malloc (4);
fooptrD.1403_2 = (intD.0 * *) D.1404_1;
D.1405_3 = 0;
return D.1405_3;
# SUCC: EXIT
}
D.1404_1 = { HEAP.5 }
HEAP.5 = { ANYTHING }
fooptr_2 = { HEAP.5 }
IE we say that fooptr_2 points to HEAP.
> . I would have liked to see
> heap_ptr points to malloc.
>
Uh,
>
> Any way I can get that information.....
> I would appreciate any idea/suggestions ...
> dz