public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/30409] [fortran] missed optimization with pure function arguments
Date: Mon, 23 Oct 2023 21:45:27 +0000	[thread overview]
Message-ID: <bug-30409-4-ukiE9jOtC4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-30409-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=30409

--- Comment #12 from kargl at gcc dot gnu.org ---
(In reply to anlauf from comment #11)
> (In reply to kargl from comment #10)
> > (In reply to anlauf from comment #8)
> 
> > which is equivalent to 
> > 
> >    tmp = 1 / y
> >    do i = 1, n
> >       ... = expression1(..., tmp)
> >    end do
> 
> No.  Strictly speaking, it is only equivalent to:
> 
>     if (n > 0) tmp = 1 / y
>     do i = 1, n
>        ... = expression1(..., tmp)
>     end do

Ah, yes, I missed the possibility that the loop may not loop at all.

  parent reply	other threads:[~2023-10-23 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-30409-4@http.gcc.gnu.org/bugzilla/>
2010-10-02  8:10 ` tkoenig at gcc dot gnu.org
2023-10-22 16:43 ` kargl at gcc dot gnu.org
2023-10-22 19:18 ` anlauf at gcc dot gnu.org
2023-10-23  5:50 ` tkoenig at gcc dot gnu.org
2023-10-23 19:23 ` kargl at gcc dot gnu.org
2023-10-23 19:28 ` anlauf at gcc dot gnu.org
2023-10-23 21:45 ` kargl at gcc dot gnu.org [this message]
2007-01-08 21:31 [Bug fortran/30409] New: " kargl at gcc dot gnu dot org
2007-01-08 21:32 ` [Bug fortran/30409] " kargl at gcc dot gnu dot org
2007-01-08 21:36 ` kargl at gcc dot gnu dot org
2007-01-09 11:11 ` rguenth at gcc dot gnu dot org
2007-01-09 16:08 ` kargl at gcc dot gnu dot org

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=bug-30409-4-ukiE9jOtC4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).