This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44773] [4.6 Regression] Unnecessary temporaries increase the runtime for channel.f90 by ~70%
- From: "tkoenig at netcologne dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2010 19:55:49 -0000
- Subject: [Bug fortran/44773] [4.6 Regression] Unnecessary temporaries increase the runtime for channel.f90 by ~70%
- References: <bug-44773-12313@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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