This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/36932] New: unneeded temporary (2x)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]