From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56008 invoked by alias); 29 Jan 2016 10:35:17 -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 55995 invoked by uid 89); 29 Jan 2016 10:35:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 29 Jan 2016 10:35:15 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 11289C003569; Fri, 29 Jan 2016 10:35:14 +0000 (UTC) Received: from tucnak.zalov.cz ([10.3.113.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0TAZCkm003512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 29 Jan 2016 05:35:13 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id u0TAZ9GC025938; Fri, 29 Jan 2016 11:35:10 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id u0TAZ7ck025937; Fri, 29 Jan 2016 11:35:07 +0100 Date: Fri, 29 Jan 2016 10:35:00 -0000 From: Jakub Jelinek To: Jason Merrill Cc: Richard Biener , "Joseph S. Myers" , Marek Polacek , Jan Hubicka , GCC Patches Subject: Re: [C++ PATCH] Fix -Wunused-function (PR debug/66869) Message-ID: <20160129103507.GM3017@tucnak.redhat.com> Reply-To: Jakub Jelinek References: <20160125203829.GP3017@tucnak.redhat.com> <20160126161813.GB3017@tucnak.redhat.com> <20160127185159.GT3017@tucnak.redhat.com> <56A91A7A.3060700@redhat.com> <20160128201506.GG3017@tucnak.redhat.com> <56AAD3B6.2060804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56AAD3B6.2060804@redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg02292.txt.bz2 On Thu, Jan 28, 2016 at 09:51:34PM -0500, Jason Merrill wrote: > On 01/28/2016 03:15 PM, Jakub Jelinek wrote: > >+ if (TREE_CODE (decl) == FUNCTION_DECL > >+ && DECL_INITIAL (decl) == 0 > >+ && DECL_EXTERNAL (decl) > >+ && !TREE_PUBLIC (decl) > >+ && !DECL_ARTIFICIAL (decl) > >+ && !TREE_NO_WARNING (decl)) > > Do we need to check both DECL_INITIAL and DECL_EXTERNAL? Dunno, but that is what cgraphunit.c does, c-decl.c too, what the old toplev.c (check_global_declaration_1) did (back to at least r26593 from ~ 1999), so I think we want some consistency. Either it is needed, or if it is not needed, then all the spots should change, not just this one. I can try to stick there an assert whether for FUNCTION_DECL (DECL_INITIAL (decl) == 0) == DECL_EXTERNAL (decl). Jakub