> > That said, second, my understanding of restrict, from reading the c99
> > standard, is that it is perfectly valid for restrict pointers to alias
> > each other during *loads*..  IE you can guarantee any restricted
> > pointer that is stored into can't alias the other restricted pointers.
> >  Those only used for loads can alias each other.
>
> How does it make a difference?  If for two pointers that are only
> loaded from we say they don't alias I cannot imagine a transformation
> that would get anything wrong.  For example EXAMPLE 2 clearly
> suggests that not both pointers need to be written to.  That is,
> EXAMPLE 3 is merely to make it defined behavior from a standards
> point of view, even if it doesn't make a difference in practice.

I share Richard's confusion.

Fortran aliasing rules also allow two arguments to alias if neither of then 
are modified. In F90 you have intent attributes to help the compiler enforce 
this, in older revisions (and if these attributes are not specified) it's up 
to the user to ensure this is true.

Paul

Reply via email to