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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #6)
> As Jakub said the behavior is the same for malloc() since years.
> 
... 
> So it might work to disable the new/delete/malloc/free optimization when
> we see a definition of those functions.

But it's surely not enough to disable transforms like

 x = 0;
 ... = new ...;
 if (x != 0)
   ..

to elide the load from x after the 'new'.  Like with malloc we assume
that state of the runtime (where malloc / new is defined) is only
accessible via API calls and not visible to the compiler at the same
time its users are.

Reply via email to