From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24042 invoked by alias); 21 Oct 2012 13:48:58 -0000 Received: (qmail 23981 invoked by uid 48); 21 Oct 2012 13:48:40 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/54997] -Wunused-function gives false warnings for procedures passed as actual argument Date: Sun, 21 Oct 2012 13:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg01871.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54997 --- Comment #5 from janus at gcc dot gnu.org 2012-10-21 13:48:38 UTC --- (In reply to comment #4) > The following removes the warning for s3: > > [...] > > but it also removes the warning on procedures which are really unused :( This fixed by the following: Index: gcc/fortran/parse.c =================================================================== --- gcc/fortran/parse.c (revision 192619) +++ gcc/fortran/parse.c (working copy) @@ -3928,7 +3928,6 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_na gfc_symtree *st; gfc_symbol *old_sym; - sym->attr.referenced = 1; for (ns = siblings; ns; ns = ns->sibling) { st = gfc_find_symtree (ns->sym_root, sym->name); @@ -4050,7 +4049,6 @@ parse_contained (int module) /* Mark this as a contained function, so it isn't replaced by other module functions. */ sym->attr.contained = 1; - sym->attr.referenced = 1; /* Set implicit_pure so that it can be reset if any of the tests for purity fail. This is used for some optimisation