public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36932]  New: unneeded temporary (2x)
@ 2008-07-25 10:48 jv244 at cam dot ac dot uk
  2008-07-25 13:06 ` [Bug fortran/36932] " tkoenig at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-07-25 10:48 UTC (permalink / raw)
  To: gcc-bugs

The line 'a=pbc(p(i)%r)' warns twice about an array temporary, but none should
be needed:

MODULE M1
  IMPLICIT NONE
  TYPE particle
   REAL :: r(3)
  END TYPE
CONTAINS
  SUBROUTINE S1()
     TYPE(particle), POINTER, DIMENSION(:) :: p
     REAL :: a(3)
     INTEGER :: i
     a=pbc(p(i)%r)
  END SUBROUTINE S1
  FUNCTION pbc(a)
     REAL :: a(3)
     REAL :: pbc(3)
     pbc=a
  END FUNCTION
END MODULE M1


-- 
           Summary: unneeded temporary (2x)
           Product: gcc
           Version: 4.4.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=36932


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-02-21 14:12 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-25 10:48 [Bug fortran/36932] New: unneeded temporary (2x) jv244 at cam dot ac dot uk
2008-07-25 13:06 ` [Bug fortran/36932] " tkoenig at gcc dot gnu dot org
2008-08-17  0:06 ` pinskia at gcc dot gnu dot org
2010-02-10  8:57 ` jv244 at cam dot ac dot uk
2010-02-13 21:13 ` jv244 at cam dot ac dot uk
2010-02-13 21:15 ` jv244 at cam dot ac dot uk
2010-02-14  9:47 ` pault at gcc dot gnu dot org
2010-02-14 19:27 ` jv244 at cam dot ac dot uk
2010-02-14 19:55 ` paul dot richard dot thomas at gmail dot com
2010-02-15  7:35 ` jv244 at cam dot ac dot uk
2010-02-16  9:05 ` pault at gcc dot gnu dot org
2010-02-16  9:22 ` jv244 at cam dot ac dot uk
2010-02-20 12:47 ` pault at gcc dot gnu dot org
2010-02-20 21:46 ` burnus at gcc dot gnu dot org
2010-02-21 14:12 ` jv244 at cam dot ac dot uk

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).