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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Domingo Alvarez from comment #0)
> The sample code is similar to a production code that do some work inside the
> custom delete if the "next" pointer is not NULL.

That's not valid. THe operator delete gets called after the object's destructor
has run, which means you can't access its members.

You can either fix the code, or use -fno-lifetime-dse to tell GCC to disable
the valid optimizations that break your invalid code.

Reply via email to