public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jv244 at cam dot ac dot uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/43072]  New: unneeded temporary (s=s+f(a))
Date: Mon, 15 Feb 2010 07:37:00 -0000	[thread overview]
Message-ID: <bug-43072-6642@http.gcc.gnu.org/bugzilla/> (raw)

Another case that doesn't need a temp:

MODULE M1
  PRIVATE
  REAL, PARAMETER :: c(2)=(/(i,i=1,2)/)
CONTAINS
  ! OK
  SUBROUTINE S0
    real :: r
     r=0
     r=S2(c)
  END SUBROUTINE S0
  ! NOT OK
  SUBROUTINE S1
    real :: r
     r=0
     r=r+S2(c)
  END SUBROUTINE S1

  FUNCTION S2(c)
     REAL, INTENT(IN) :: c(2)
     s2=0
  END FUNCTION S2
END MODULE M1

In S1, somehow it seems that 'c' is being packed if S2 is part of an expression


-- 
           Summary: unneeded temporary (s=s+f(a))
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


             reply	other threads:[~2010-02-15  7:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15  7:37 jv244 at cam dot ac dot uk [this message]
2010-02-15  7:51 ` [Bug fortran/43072] " pault at gcc dot gnu dot org
2010-02-15  7:58 ` jv244 at cam dot ac dot uk
2010-02-16 15:47 ` pault at gcc dot gnu dot org
2010-02-20 12:47 ` pault at gcc dot gnu dot org
2010-02-20 21:48 ` burnus at gcc dot gnu dot org
2010-02-21 10:44 ` paul dot richard dot thomas at gmail dot com
2010-02-22  5:44 ` pault at gcc dot gnu dot org
2010-05-09 20:19 ` dfranke at gcc dot gnu dot org
2010-05-19  4:28 ` pault 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-43072-6642@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).