This is the mail archive of the gcc-patches@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]

Re: PATCH to implement `restrict' in C


>>>>> "Richard" == Richard Henderson <rth@cygnus.com> writes:

    Richard> On Sat, Oct 10, 1998 at 08:53:39PM -0700, Mark Mitchell
    Richard> wrote: But if the assignment `q = p' did not exist, then
    Richard> Q could not be said to be based on P and so there is no
    Richard> aliasing possible.

    >>  Right.  But, you can't tell this apriori.

    Richard> If you mean on any isolated statement, you are correct.

Yes, thanks for clarifying.

    Richard> I guess I was misinterpreting you to mean that you
    Richard> couldn't tell if p and q aliased even at the beginning of
    Richard> the block.

    >> Correct.  Note that if, by some data flow analysis, you can
    >> show that b is never assigned to, you can make the alias set
    >> for `b' be a subset of `int', and then get the benefit you
    >> would hope for.

    Richard> That sounds backwards.  Consider

You're right here as well.  I was trying too hard to simplify.  Here's
what I meant, more precisely.  I envision a further additional
operation on alias sets (which are gradually becoming more and more
like sets, which was my original idea...).  In particular, set
difference.  So, given:

  void foo (int* restrict a, int* const b);

we would say that `b' is in the alias set `int - a' (all `int's but
not `a').  Then, in your situation, where `b' was not `const', but, by
hypothesis was somehow proved never to become based on `a', it could
also be in the `int - a' alias set.

    Richard> You are right, and I apologise.

Thank you.  Very courteously said.

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com


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