public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael.morin@sfr.fr>
To: Janus Weil <janus@gcc.gnu.org>
Cc: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran] PR 54997: -Wunused-function gives false warnings for procedures passed as actual argument
Date: Sun, 25 Nov 2012 19:17:00 -0000	[thread overview]
Message-ID: <50B26E45.9030309@sfr.fr> (raw)
In-Reply-To: <CAKwh3qiWRSRLmmD1MLKnYH3aC81CG7adi2nhbwE+3C8VtY+DyQ@mail.gmail.com>

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<janus@gcc.gnu.org>:
>> 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<janus@gcc.gnu.org>
>>
>>          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<janus@gcc.gnu.org>
>>
>>          PR fortran/54997
>>          * gfortran.dg/warn_unused_function_2.f90: New.

  parent reply	other threads:[~2012-11-25 19:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-21 23:33 Janus Weil
2012-10-22 15:22 ` Janus Weil
2012-10-29 20:36   ` Janus Weil
2012-11-25 19:17   ` Mikael Morin [this message]
2012-11-26 11:21     ` Janus Weil
2012-11-26 11:48       ` Mikael Morin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B26E45.9030309@sfr.fr \
    --to=mikael.morin@sfr.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=janus@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).