From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67381 invoked by alias); 7 Aug 2019 14:12:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 67373 invoked by uid 89); 7 Aug 2019 14:12:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-lj1-f193.google.com Received: from mail-lj1-f193.google.com (HELO mail-lj1-f193.google.com) (209.85.208.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Aug 2019 14:12:31 +0000 Received: by mail-lj1-f193.google.com with SMTP id r9so85620094ljg.5 for ; Wed, 07 Aug 2019 07:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=x8vmwiIA66oM+ter5XVwtHKqtBU0lLudKoWnY8lDKWM=; b=sqlyPKE3bUvJ+jj4IYYMbylF+nJ3kBIy2h7RlZ49VRlAtb1yCjBKOff/yqqJJ779A4 OrdD6dZ3Nd4eBUuvGeH+/ujRLPhOfy+ZZWmBPXhochLtuvt6tj1mJyOBFnsmEWM/UU41 XYdblQ7F8GRhY0dpiqLuiEzNIwDLztVYZF5EaiuDGf7ez0maIojzOnDKOySXl/3FQKFI JcNBwzJLKI/ifj5NG57DBR+NA+6GH8pFaHAaU9vY4yrFE/bl2cglxS2kbX/Mt6oTvQr0 hl1dK/x1vuwB+7b4XVJOdNtDNavL1j7s2nzoMShPkka3M4vHJb9ehQRYeBTPJI/NYOj3 On0w== MIME-Version: 1.0 References: <4dcdd0cb-dc8d-73f4-75a2-8ad1e91731fc@suse.cz> <20190807105104.GE2726@tucnak> In-Reply-To: From: Richard Biener Date: Wed, 07 Aug 2019 14:35:00 -0000 Message-ID: Subject: Re: [PATCH] Handle new operators with no arguments in DCE. To: =?UTF-8?Q?Martin_Li=C5=A1ka?= Cc: Jakub Jelinek , Marc Glisse , "H.J. Lu" , David Malcolm , GCC Patches , dominik.infuehr@theobroma-systems.com, Jan Hubicka , Martin Jambor Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00469.txt.bz2 On Wed, Aug 7, 2019 at 2:04 PM Martin Li=C5=A1ka wrote: > > On 8/7/19 12:51 PM, Jakub Jelinek wrote: > > On Wed, Aug 07, 2019 at 12:44:28PM +0200, Martin Li=C5=A1ka 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) =3D NONE; > > Well, how are lambdas involved in the new/delete DCE here? Lambdas with r= emoved > 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 > > >