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: GCC not (optimally) exploiting restrict pointers?


On Wed, 15 Dec 2004, Steven Bosscher wrote:

> On Wednesday 15 December 2004 13:34, Richard Guenther wrote:
> > Now, if I read 6.7.3 (7)
>
> ... of the C99 standard ...

Yes, restrict is introduced by C99, but available as a GNU extension, too.

> > correct, the second output is correct for the
> > first case, too.
>
> Perhaps you can explain why? :-)

It reads:

(7) An object that is accessed through a restrict-qualified pointer has a
  special association with that pointer. This association, defined in
  6.7.3.1 below, requires that all accesses to that object use, directly or
  indirectly, the value of that particular pointer.

So, the value in *a has to be accessed through a exclusively and
cannot be accessed through b, regardless of any type qualifiers
present on b or not.  Though all examples given in 6.7.3.1 have
both pointers restrict qualified - this is why I am not 100% sure.

Richard.

--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


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