public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Koenig <tkoenig@netcologne.de>
To: Janus Weil <janus@gcc.gnu.org>, Fritz Reese <fritzoreese@gmail.com>
Cc: fortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran] PR 85599: warn about short-circuiting of logical expressions for non-pure functions
Date: Tue, 17 Jul 2018 17:34:00 -0000	[thread overview]
Message-ID: <13295d17-0718-a0af-d6bf-d30b523af848@netcologne.de> (raw)
In-Reply-To: <CAKwh3qjuDACiWBEC47SDuLv6uAbBe8VA8jVr2U-bXonJ_WE41Q@mail.gmail.com>

Am 17.07.2018 um 19:19 schrieb Janus Weil:
> 2018-07-17 17:18 GMT+02:00 Fritz Reese <fritzoreese@gmail.com>:
>>> 2018-07-17 9:52 GMT+02:00 Janus Weil <janus@gcc.gnu.org>:
>>>> In other words: Does it make sense to tone down
>>>> -Wfunction-elimination, by only warning about impure functions?
>>>
>>> Here is an update of the patch which does that. Regtesting now ...
>>
>> Would not this break the testcase function_optimize_5.f90 :
> 
> My regtest says so as well ;)
> 
> 
>> The docs for -Wfunction-elimination would read:
>>
>>> Warn if any calls to functions are eliminated by the optimizations
>>> enabled by the @option{-ffrontend-optimize} option.
>>> This option is implied by @option{-Wextra}.
>>
>> However, with your patch, it should probably read something like "warn
>> if any calls to impure functions are eliminated..." Possibly with an
>> explicit remark indicating that pure functions are not warned.
> 
> Yes.
> 
> However, the test case above seems to indicate that the
> function-elimination optimization is not applied to impure functions
> anyway (which is good IMHO).

If you specify -faggressive-function-elimination, it is also
done for impure (and non implicitly-pure) functions.

Problem is that, in all probability, nobody uses this option at the
moment.

> It that is true, then my modifications
> practically disable the old -Wfunction-elimination warnings completely
> :/
I do not think it would be a problem not to warn for removing
calls to pure or implicitly pure fuctions. The test cases can
easily be modified not to emit this warning, as you did.

As the author of the original test cases, I may be able to
say so with a certain amount of credibility.

The actual elimination is checked for by counting the
function names in the *.original dump file, which is done.

  reply	other threads:[~2018-07-17 17:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-11 21:06 Janus Weil
2018-07-12 19:43 ` Janus Weil
2018-07-13  8:03   ` Janus Weil
2018-07-15 20:39     ` Janus Weil
2018-07-15 20:57       ` Thomas Koenig
2018-07-16  8:07         ` Janus Weil
2018-07-16 19:51           ` Thomas Koenig
2018-07-17  5:08             ` Janus Weil
2018-07-17  7:52               ` Janus Weil
2018-07-17 14:32                 ` Janus Weil
2018-07-17 15:19                   ` Fritz Reese
2018-07-17 17:19                     ` Janus Weil
2018-07-17 17:34                       ` Thomas Koenig [this message]
2018-07-17 18:36                         ` Janus Weil
2018-07-17 18:55                           ` Fritz Reese
2018-07-17 19:21                             ` Janus Weil
2018-07-18 18:43                               ` Janus Weil
2018-07-12 11:17 Dominique d'Humières
2018-07-12 14:12 ` Janus Weil
2018-07-12 14:35   ` Dominique d'Humières
2018-07-12 14:55     ` Janus Weil
2018-07-12 19:53       ` Thomas Koenig
2018-07-12 20:03         ` Janus Weil

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=13295d17-0718-a0af-d6bf-d30b523af848@netcologne.de \
    --to=tkoenig@netcologne.de \
    --cc=fortran@gcc.gnu.org \
    --cc=fritzoreese@gmail.com \
    --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).