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: unassig...@gcc.gnu.org ReportedBy: bur...@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.