This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Marking C++ new operator as malloc?
On 9/9/07, Richard Guenther <richard.guenther@gmail.com> wrote:
> On 9/9/07, Mark Mitchell <mark@codesourcery.com> wrote:
> > Richard Guenther wrote:
> >
> > > I don't know of any place we would use such information. At least
> > >
> > > int *p = new int;
> > > int *q = new int;
> > > if (p == q)
> > >
> > > cannot be simplified as both pointers may be NULL?
A better one:
int *p = new int;
foo(p);
int *q = new int;
if foo deletes p then q may be equal to p. But alias analysis still
(validly!) says they don't alias.
Richard.