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/44773] [4.6 Regression] Unnecessary temporaries increase the runtime for channel.f90 by ~70%



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


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