From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 665B4398082C; Tue, 1 Jun 2021 13:01:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 665B4398082C From: "nadavhalahmi560 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/100855] New: pow run time gfortran vs ifort Date: Tue, 01 Jun 2021 13:01:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nadavhalahmi560 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jun 2021 13:01:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100855 Bug ID: 100855 Summary: pow run time gfortran vs ifort Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: nadavhalahmi560 at gmail dot com Target Milestone: --- I wrote the code below: ``` program power implicit none real :: sum, n, q integer :: i, j integer :: limit real :: start, finish sum =3D 0d0 limit =3D 10000 n =3D 2.0 q =3D 0.5 call CPU_TIME(start) do j=3D1,limit do i=3D1, limit n =3D n*q sum =3D sum + (i ** (0.05 + n)) end do end do call CPU_TIME(finish) print *, sum print '("Time =3D ",f6.3," seconds.")',finish-start end program power ``` and compiled it using: ifort pow.f90 -O3 -no-vec -o intel.out gfortran pow.f90 -O3 -fno-tree-vectorize -o gnu.out When I run `./intel.out` I get the following output: 3.3554432E+07 Time =3D 1.615 seconds. When I run `./gnu.out` I get the following output: 33554432.0=20=20=20=20 Time =3D 7.817 seconds. Therefore, gfortran is much slower than ifort. I get similar behavior for `= log` and `exp` functions. gfortran -v: Using built-in specs. COLLECT_GCC=3Dgfortran COLLECT_LTO_WRAPPER=3D/software/x86_64/3.10.0/gcc/11.1.0/libexec/gcc/x86_64= -pc-linux-gnu/11.1.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=3D/software/x86_64/3.10.0/gcc/11.1.0 --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.1.0 (GCC)=20 ifort -v: ifort version 19.1.3.304=