On Wed, Aug 7, 2019 at 2:04 PM Martin Liška <mli...@suse.cz> wrote:
>
> On 8/7/19 12:51 PM, Jakub Jelinek wrote:
> > On Wed, Aug 07, 2019 at 12:44:28PM +0200, Martin Liška wrote:
> >> On 8/7/19 11:51 AM, Richard Biener wrote:
> >>> I think the simplest way to achieve this is to not copy, aka clear,
> >>> DECL_IS_OPERATOR_* when cloning and removing arguments
> >>> (cloning for a constant align argument should be OK for example, as is
> >>> for a constant address).  Or simply always when cloning.
> >>
> >> Ok, then I'm suggesting following tested patch.
> >>
> >> Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
> >
> > What about LAMBDA_FUNCTION, doesn't cloning which changes arguments in any
> > way invalidate that too, i.e. shouldn't it be just
> >   FUNCTION_DECL_DECL_TYPE (new_node->decl) = NONE;
>
> Well, how are lambdas involved in the new/delete DCE here? Lambdas with 
> removed
> arguments should not interfere here.

But for coverage where we do

  gcov_write_unsigned (DECL_ARTIFICIAL (current_function_decl)
                       && !DECL_FUNCTION_VERSIONED (current_function_decl)
                       && !DECL_LAMBDA_FUNCTION_P (current_function_decl));

all clones should be considered artificial?

Anyway, your patch is OK, we can think about lambdas separately.  Can you
simplify the DCE code after the patch?

Thanks,
Richard.

> > instead?  On the other side, if the cloning doesn't change arguments in any
> > way, do we still want to clear those flags?
>
> Well, I would consider it safer to drop it always.
>
> Martin
>
> >
> >       Jakub
> >
>

Reply via email to