This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Detect not-cloned new/delete operators in DCE.
On Wed, Aug 7, 2019 at 10:56 AM Martin Liška <firstname.lastname@example.org> wrote:
> On 8/6/19 5:44 PM, Marc Glisse wrote:
> > On Tue, 6 Aug 2019, Martin Liška wrote:
> >> Anyway, I'm sending patch that considers only such new/delete operators
> >> that are not a clone of an original type. That should make the current
> >> DCE code more solid.
> > DECL_IS_REPLACEABLE_OPERATOR_NEW_P seems to have been replaced with DECL_IS_OPERATOR_NEW_P. Is that on purpose?
> Whoops, that was not intentional, thanks for heads up.
> > I like your cleanup of having a single function to decide if this is the kind of operator new/delete DCE can handle, but you may have introduced long lines in the substitution.
> Long lines should be fixed now as well.
> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> Ready to be installed?
As said in the other thread I prefer you unsed DECL_IS_OPERATOR_* when
cloning. As much as
I dislike void memcpy (int yeah, double foo); be represented as
BUILT_IN_MEMCPY I dislike
an operator that doesn't follow its signature as such.
If you go as far as looking at the abstract origin you could figure
the original param position
by looking at the to-be-DCEd operator invocations DECL_ARGUMENTS, look at _its_
abstract origin and match that up when walking the operators abstract
But I think this is all hardly worth the trouble.