On Wed, Apr 08, 2020 at 09:20:07AM -0400, Jason Merrill via Gcc-patches wrote: > On 4/8/20 4:47 AM, Richard Biener wrote: > > On Tue, Apr 7, 2020 at 5:01 PM Martin Liška <mli...@suse.cz> wrote: > > > > > > Hi. > > > > > > The patch allows DCE to remove only replaceable operators new and delete. > > > That's achieved by proper mark up of all these operators in C++ FE. > > > The patch also brings all tests we've collected so far for the PR. > > > > > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > > > > > Ready to be installed? > > > > Grepping for uses of DECL_IS_OPERATOR_* reveals you miss comparing > > the new flag in ipa-icf.c and cgraph node dumping in cgraph.c might want > > to dump it as well. > > > > Otherwise it looks reasonable. > > > > So the mid-end parts are OK in case FE people are happy with this solution > > for GCC 10. > > This seems fine for GCC 10, though I wonder about using an attribute for > DECL_REPLACEABLE_OPERATOR rather than taking a bit in all FUNCTION_DECLs > that will only ever be set on a small handful.
If it is just for GCC 10 and we'll return the bit back to unused in GCC 11, I'd think it is acceptable. > For GCC 11 we probably want to make the distinction Jonathan mentions > between new-expressions and direct calls to operator new. Yeah. Jakub