GCC not (optimally) exploiting restrict pointers?

Richard Guenther rguenth@tat.physik.uni-tuebingen.de
Wed Dec 15 17:29:00 GMT 2004


On Wed, 15 Dec 2004, Dave Korn wrote:

> > -----Original Message-----
> > From: gcc-owner On Behalf Of Richard Guenther
> > Sent: 15 December 2004 12:52
>
> > On Wed, 15 Dec 2004, Steven Bosscher wrote:
> >
> > > On Wednesday 15 December 2004 13:34, Richard Guenther wrote:
>
> > > 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.
>
> .... unless of course b was derived from a in the function that calls foo(),
> perhaps?

Which would invoke undefined behavior as people agreed on in
http://gcc.gnu.org/ml/gcc-patches/2004-08/msg00246.html

> >  Though all examples given in 6.7.3.1 have
> > both pointers restrict qualified - this is why I am not 100% sure.
>
>   It's highly suggestive.

Yeah ;)  And the Intel compiler ignoring this highly suggestive
examples, too.

Richard.

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



More information about the Gcc mailing list