https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50374

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Joost.VandeVondele at mat dot 
ethz
                   |                            |.ch

--- Comment #28 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 
---
actually, minloc/maxloc are also Fortran intrinsics, and while expanded inline,
don't vectorize either. The following testcase runs 5x faster with ifort than
with gfortran:

INTEGER FUNCTION ana(a)
 REAL :: a(1024)
 ana=maxloc(a,1)
END FUNCTION


INTEGER :: NRUN=1000000
REAL :: a(1024)
INTEGER :: ana,I
a=(/(I,I=1,1024)/)
DO I=1,NRUN
   j=j+ana(a)
ENDDO
WRITE(6,*) NRUN,j,ana(a)
END

> ifort -fast -no-ipo -fno-inline-functions t.f90 ; time ./a.out
     1000000  1024000000        1024

real    0m0.233s
user    0m0.228s
sys    0m0.004s

> gfortran -Ofast -fno-inline-functions t.f90 ; time ./a.out
     1000000  1024000000        1024

real    0m1.193s
user    0m1.188s
sys    0m0.000s

Reply via email to