This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52473] New: CSHIFT slow - inline it?
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Mar 2012 20:00:24 +0000
- Subject: [Bug fortran/52473] New: CSHIFT slow - inline it?
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52473
Bug #: 52473
Summary: CSHIFT slow - inline it?
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
For the program http://www.cita.utoronto.ca/~pen/MHD/mhd.f90 GCC produces
relatively slow code:
$ gfortran -Ofast mhd.f90; time ./a.out > /dev/null
real 0m0.534s
$ pathf95 -O3 mhd.f90; time ./a.out > /dev/null
real 0m0.169s
Which is 3.2 times faster. A closer analyis shows that it is sufficient to
compile the functions advectbyzx, tvd1 and tvdb with pathf95 to gain the same
speed. If one only compiles advectbyzx and tvd1 (and the rest with gfortran)
the speed is 0m0.301s.
The performance difference seems to be due to the calls to _gfortran_cshift0_4.
Expected: CSHIFT should be inlined (at least for a scalar SHIFT) - as pathf95
and ifort do.
* * *
13.7.43 CSHIFT (ARRAY, SHIFT [, DIM])
Description. Circular shift of an array.Description. Circular shift of an
array.