GCC not (optimally) exploiting restrict pointers?

Dave Korn dave.korn@artimi.com
Wed Dec 15 18:01:00 GMT 2004

> -----Original Message-----
> From: Joe Buck 
> Sent: 15 December 2004 17:55

> On Wed, Dec 15, 2004 at 05:10:14PM -0000, Dave Korn wrote:
> > > From: gcc-owner On Behalf Of Richard Guenther
> > > 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?
> Nope.  The whole point of restrict is that you're making a promise to the
> compiler that an optimization is safe.  If you lie, you lose.

  It's pretty hard to tell from the wording of the standard exactly what that
promise is that is being asked of you.  I thought that the wording allowed for
that case, but the post people have quoted make the terminology a lot clearer.

Can't think of a witty .sigline today....

More information about the Gcc mailing list