This is the mail archive of the
mailing list for the GCC project.
On Fri, May 10, 2002 at 12:18:22PM +0100, Jason Merrill wrote:
> It seems that restrict provides this sort of guarantee; in this testcase,
> can the compiler avoid doing two loads from *p?
> int i;
> void f ();
> void g (int *__restrict p)
> int j = *p;
> f ();
> j += *p;
> i = j;
At the moment, I think not, but is that test case really going to help
you at all with vtables? Cause I would think the most common form would
include passing the THIS pointer to the function, so you wind up with
"f(p)" which means that the function _can_ name p, which means that it
can modify the contents.