From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52662 invoked by alias); 21 Dec 2018 10:05:24 -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 52646 invoked by uid 89); 21 Dec 2018 10:05:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1128 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Dec 2018 10:05:19 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A60CB8050A; Fri, 21 Dec 2018 10:05:17 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 039D7177BC; Fri, 21 Dec 2018 10:05:14 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id wBLA5CkT006192; Fri, 21 Dec 2018 11:05:12 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id wBLA596M006191; Fri, 21 Dec 2018 11:05:09 +0100 Date: Fri, 21 Dec 2018 10:28:00 -0000 From: Jakub Jelinek To: Martin Sebor , "Joseph S. Myers" , Marek Polacek , Jason Merrill , Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] attribute copy, leaf, weakref and -Wmisisng-attributes (PR 88546) Message-ID: <20181221100509.GY23305@tucnak> Reply-To: Jakub Jelinek References: <6ff6565b-51d8-8620-f345-a0082747297b@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ff6565b-51d8-8620-f345-a0082747297b@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01546.txt.bz2 Hi! I think the main question is whether we should accept leaf attribute on weakrefs, despite them being marked as !TREE_PUBLIC. I know we haven't allowed that until now, but weakrefs are weirdo things which have both static and external effects, static for that they are a local alias and external for being actually aliases to (usually) external functions. If we add a weakref for some function declared as leaf, it is unnecessarily pessimizing when we don't allow the leaf attribute on the weakref. Your patch looks reasonable to me to revert to previous state, but if we decide to change the above, it would need to change. On Thu, Dec 20, 2018 at 08:45:03PM -0700, Martin Sebor wrote: > --- gcc/c-family/c-attribs.c (revision 267282) > +++ gcc/c-family/c-attribs.c (working copy) > @@ -2455,6 +2455,12 @@ handle_copy_attribute (tree *node, tree name, tree > || is_attribute_p ("weakref", atname)) > continue; > > + /* Aattribute leaf only applies to extern functions. > + Avoid copying it to static ones. */ s/Aatribute/Attribute/ Jakub