This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Proposed resolution to aliasing issue.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]