https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78104

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Markus Trippelsdorf from comment #0)
> > A simple example:
> > 
> > int main() {
> >   int *ob = new int();
> >   delete ob;
> > }
> > 
> > clang optimizes it away:
> 
> Which is funny considering what Chris Lattner  wrote in PR 23383 comment #4:
> This would not be legal, there is no reason operator new can't return a
> pointer that already exists in the program.

Note optimizing away is not about aliasing but recognizing a new/delete pair.

But yes, there are (plenty of) duplicates.  Just go find them...

Reply via email to