Proposed resolution to aliasing issue.

Andrew Pinski pinskia@physics.uc.edu
Wed May 11 22:10:00 GMT 2005


On May 11, 2005, at 2:42 PM, Mark Mitchell wrote:
> Our proposed approach is to -- by default -- assume that "g" may 
> access all of "b".  However, in the event that the corresponding 
> parameter to "g" has an attribute (name TBD, possibly the same as the 
> one that appears in Danny's recent patch), then we may assume that "g" 
> (and its callees) do not use the pointer to obtain access to any 
> fields of "b".
>
> For example:
>
>   void g(A *p __attribute__((X)));
>
>   void f() {
>     B b;
>     g(&b.a); /* Compiler may assume the rest of b is not accessed
>                 in "g".  */
>   }

If we go with this proposal, please make sure that all of the un-nested
structs are marked with attribute as this is where I see where most of
the benefit.

Thanks,
Andrew Pinski



More information about the Gcc mailing list