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, 10 May 2002, Jason Merrill wrote:

> >   int i;
> >   void f ();
> >   void g (int *__restrict p)
> >   {
> >     int j = *p;
> >     f ();
> >     j += *p;
> >     i = j;
> >   }
> 
> Here's a preliminary patch to implement those semantics, and to give all
> vtable pointers a unique, restricted alias set.  Comments?

Many alias analysis cases can (and so should) have testcases added to the
testsuite (for the code above, call a nonexistent function if j != *p just
after f (), and test that the call is optimised out so the program
successfully links).  (Of course in such a case make sure that the
testcase is indeed testing the patch - that it fails before the patch, as
well as passing afterwards.)  I don't however know whether the C++ case in 
question is amenable to such testing.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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