This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/31066] New: Fortran testcase where inlining would be a huge gain
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Mar 2007 10:19:47 -0000
- Subject: [Bug middle-end/31066] New: Fortran testcase where inlining would be a huge gain
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
On the following testcase:
program test
integer, parameter :: n = 25000
integer :: i
real, dimension(n) :: iener, dens, pres, temp, gamma, cs
do i = 1, 30000
call eos (iener, dens, pres, temp, gamma, cs, sheat, cgamma)
end do
contains
subroutine eos (iener, dens, pres, temp, gamma, cs, sheat, cgamma)
real sheat, cgamma
real, dimension(n) :: iener, dens, pres, temp, gamma, cs
temp(:n) = iener(:n)/sheat
pres(:n) = (cgamma - 1.0)*dens(:n)*iener(:n)
gamma(:n) = cgamma
cs(:n) = sqrt(cgamma*pres(:n)/dens(:n))
end subroutine eos
end program test
(derived from the Polyhedron gas_dyn.f90 benchmark), the Intel compiler gains
50% execution speedup by inlining the subroutine when vectorization is enabled
(from 9.0s to 4.4s on my AMD64/linux, using option -ip in addition to -O3 -xW).
gfortran does inline the eos_ subroutine also, but it somehow doesn't use it
for better vectorization, and it stays at the same execution time (around 10s).
--
Summary: Fortran testcase where inlining would be a huge gain
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31066