From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28254 invoked by alias); 25 Nov 2012 19:17:08 -0000 Received: (qmail 28231 invoked by uid 22791); 25 Nov 2012 19:17:07 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp21.services.sfr.fr (HELO smtp21.services.sfr.fr) (93.17.128.3) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Nov 2012 19:17:01 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2111.sfr.fr (SMTP Server) with ESMTP id 28B73700004A; Sun, 25 Nov 2012 20:17:00 +0100 (CET) Received: from [192.168.1.58] (211.183.72.86.rev.sfr.net [86.72.183.211]) by msfrf2111.sfr.fr (SMTP Server) with ESMTP id D75A27000043; Sun, 25 Nov 2012 20:16:59 +0100 (CET) X-SFR-UUID: 20121125191659882.D75A27000043@msfrf2111.sfr.fr Message-ID: <50B26E45.9030309@sfr.fr> Date: Sun, 25 Nov 2012 19:17:00 -0000 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121107 Thunderbird/10.0.10 MIME-Version: 1.0 To: Janus Weil CC: gfortran , gcc-patches Subject: Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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 X-SW-Source: 2012-11/txt/msg02058.txt.bz2 Le 22/10/2012 16:49, Janus Weil a écrit : > Minor update to the patch: It now also sets TREE_USED for entry > masters in order to avoid bogus warnings for procedures with ENTRY > (cf. comment 6 in the PR, which like comment 0 is a 4.8 regression). > > Still regtests cleanly. Ok? OK with an extra test for comment 6. Thanks. And sorry for the delay. Mikael > > Cheers, > Janus > > > > 2012/10/21 Janus Weil: >> Hi all, >> >> here is another patch to silence some more of the bogus warnings about >> unused functions that gfortran is currently throwing (cf. also the >> previous patch for PR 54224). >> >> It fixes the usage of the 'referenced' attribute, which should only be >> given to procedures which are actually 'used' (called/referenced). >> Then TREE_USED is set according to this attribute, which in turn >> silences the warning in the middle-end. >> >> The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk? >> >> Cheers, >> Janus >> >> >> 2012-10-21 Janus Weil >> >> PR fortran/54997 >> * decl.c (match_procedure_decl): Don't set 'referenced' attribute >> for PROCEDURE declarations. >> * parse.c (gfc_fixup_sibling_symbols,parse_contained): Don't set >> 'referenced' attribute for all contained procedures. >> * trans-decl.c (gfc_get_symbol_decl): Allow for unreferenced procedures. >> (build_function_decl): Set TREE_USED for referenced procedures. >> >> 2012-10-21 Janus Weil >> >> PR fortran/54997 >> * gfortran.dg/warn_unused_function_2.f90: New.