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: TREE_UNCHANGING?


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.


r~


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