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

--- Comment #11 from Kern Sibbald <kern at sibbald dot com> ---
I recently discussed both of these "optimizations" with Bjarne Stroustrup and
his comment about deleting the memset() when overriding the new() functions
was:

   Looks like a bug to me

His comment about deleting the test for a NULL class pointer was:

  Yes. According to the standard no object can exists at address 0, so the
optimization seems valid.


So, I repeat: please remove your "bug" that deletes memset() code and causes
program failures.

Despite what he says about removing the NULL pointer, when you do so, you make
it impossible with standard C++ to prevent a seg fault is someone calls a class
function (by error or on purpose) with a NULL pointer.  Please rmove this
useless optimization.

Both of your optimizations do not make sense, they give no practical
improvement to the compiler and only serve to introduce failures to programs
that otherwise would run correctly.

Reply via email to