https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88118
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2018-11-21 Ever confirmed|0 |1 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Yeah, we have code special-casing BUILT_IN_MALLOC and friends but not DECL_IS_OPERATOR_NEW. And we do not have DECL_IS_OPERATOR_DELETE. If clang removes the new calls then DECL_IS_OPERATOR_NEW may not have side-effects that need to be preserved. (hopefully) Look in tree-ssa-dce.c for BUILT_IN_MALLOC handling and amed it with DECL_IS_OPERATOR_NEW. Profit!