public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at netcologne dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/44773] [4.6 Regression] Unnecessary temporaries increase the runtime for channel.f90 by ~70%
Date: Thu, 08 Jul 2010 19:56:00 -0000	[thread overview]
Message-ID: <20100708195549.24197.qmail@sourceware.org> (raw)
In-Reply-To: <bug-44773-12313@http.gcc.gnu.org/bugzilla/>



------- Comment #13 from tkoenig at netcologne dot de  2010-07-08 19:55 -------
Subject: Re:  [4.6 Regression] Unnecessary temporaries
 increase the runtime for channel.f90 by ~70%

Hello Paul,

> That is the context - apply it and see.

What about

module baz
  implicit none
contains
  subroutine bar(x)
    real, dimension(:,:,:) :: x
    x = 3.0
  end subroutine bar
end module baz

program sw
  use baz
  implicit none
  integer, parameter :: n = 4, m = 7,  k = 5
  real ,dimension(M,N)::               f,dudx,dvdy,dhdx,dhdy
  real, dimension(m,n,k) :: u
  u = 1.0
  dudx = ddx(u(:,:,2))
  print *,dudx
contains
  real function ddx(array)
  real, dimension(:,:) :: array
  call bar(u)
  ddx = array(1,1)
  end function ddx
end program sw

AFAICS, this is legal and would require a temporary.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44773


  parent reply	other threads:[~2010-07-08 19:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01 21:22 [Bug fortran/44773] New: " dominiq at lps dot ens dot fr
2010-07-02  7:31 ` [Bug fortran/44773] " burnus at gcc dot gnu dot org
2010-07-02  8:19 ` dominiq at lps dot ens dot fr
2010-07-02  8:46 ` mikael at gcc dot gnu dot org
2010-07-02  8:51 ` dominiq at lps dot ens dot fr
2010-07-02 15:25 ` jvdelisle at gcc dot gnu dot org
2010-07-02 16:53 ` dominiq at lps dot ens dot fr
2010-07-03  9:37 ` tkoenig at gcc dot gnu dot org
2010-07-03 17:03 ` tkoenig at gcc dot gnu dot org
2010-07-04 10:49 ` dominiq at lps dot ens dot fr
2010-07-08 11:41 ` ubizjak at gmail dot com
2010-07-08 12:30 ` pault at gcc dot gnu dot org
2010-07-08 13:33 ` burnus at gcc dot gnu dot org
2010-07-08 15:33 ` paul dot richard dot thomas at gmail dot com
2010-07-08 19:56 ` tkoenig at netcologne dot de [this message]
2010-07-08 19:57 ` burnus at gcc dot gnu dot org
2010-07-09 12:02 ` dominiq at lps dot ens dot fr
2010-07-09 12:27 ` burnus at gcc dot gnu dot org
2010-07-10 14:57 ` pault at gcc dot gnu dot org
2010-07-10 17:09 ` pault at gcc dot gnu dot org
2010-07-11 16:07 ` pault at gcc dot gnu dot org
2010-07-12  6:31 ` paul dot richard dot thomas at gmail dot com
2010-07-12  7:26 ` steven 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=20100708195549.24197.qmail@sourceware.org \
    --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).