On Sat, 2005-11-26 at 02:14 +0000, shreyas krishnan wrote:
> Hi
>     I am trying to understand the workings of alias analysis and why
> it behaves it a particular way. I am using the alias analysis branch
> of gcc4.0
> 
>       I find that for the following snippet of code
>                  main()
>                  {
>                      foo(A)
> 
>                  }
> 
>                 foo(int** array) { }
> 
> 
> Array is retuned as points-to ANYTHING in the points to set!!  
> Interprocedual alias analayis is supposed to be hard  but why is that
> ?  If the functions address is not taken, isnt is a matter of just
> matching formal and actual arguments and doing a closure. 

No, global functions that are non-static can still be called from
outside the translation unit, so you still can't know what their
arguments will alias.  They must be assumed to aliasing any global +
anything that escape.

Context sensitive pointer analysis could tell you that the call to foo
in main doesn't alias anything.


> Is the 
> persumed hardness because the whole source of the program might not be
> available and so all the call sites might not be found.

It's not presumed hardness. It is a matter of simple correctness.

> 
> I will apreciate any answers/papers/ pointers  to understand this
> thanks
> Shrey

Reply via email to