[PATCH] D79378: PR34581: Don't remove an 'if (p)' guarding a call to 'operator delete(p)' under -Oz.

Shiva Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 2 20:41:13 PST 2023


shiva0217 added a comment.
Herald added a project: All.

Hi,

I have a question for the delete function call sinking in -Oz.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf.
According to 3.7.4.2/3
` The value of the first argument supplied to a deallocation function may be a null pointer value; if so, and if the deallocation function is one supplied in the standard library, the call has no effect. Otherwise, the behavior is undefined`

It seems the null checking can be skipped only when the delete is not from the standard library(have been overloaded by the user), isn't it?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79378/new/

https://reviews.llvm.org/D79378



More information about the llvm-commits mailing list