[Bug c++/94314] [10 Regression] Optimizing mismatched new/delete pairs since r10-2106-g6343b6bf3bb83c87

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 25 11:24:45 GMT 2020


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

--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> ---
I don't think we need heavy machinery linking new and delete (and if we did I'd
be tempted to store it in some global table rather than in the nodes). The most
important case is the global replacable functions, for which we have a finite
list, and for those a few checks like not matching array with non-array
versions should do. For user overloads with attribute malloc (a gcc extension),
I would go with heuristics like both/neither being class members, being members
of the same class, etc. Although I am not quite sure how doable that is from
the middle-end, how much of that information is still available (I think it is
available in the mangled name, but demangling doesn't seem like a great idea).


More information about the Gcc-bugs mailing list