[Bug libfortran/34128] New: slow gfortran 4.x (library?) compared to g77 3.4

mnoble at space dot mit dot edu gcc-bugzilla@gcc.gnu.org
Fri Nov 16 22:23:00 GMT 2007


The following codes (compiled as demo1.f and demo2.f)

      PROGRAM demo1                     PROGRAM demo2

      integer i                         integer i
      double precision result           double precision result

      do i=1,8000000                    do i=1,500000000
         result = sin(i*3.14159)           result = i*3.14159
      enddo                             enddo

      print*,'result = ',result         print*,'result = ',result
      END                               END

reveal marked performance disparities between g77 and gfortran on an
x86_64 Debian Linux 4.0 machine with 4 AMD Opteron cores:

        vendor_id       : AuthenticAMD
        cpu family      : 15
        model           : 65
        model name      : Dual-Core AMD Opteron(tm) Processor 2216
        stepping        : 2
        cpu MHz         : 2400.452

Sample timings are given below, comparing the Debian binary package
of g77 3.4.6 against both gfortran 4.1.2 (Debian binary package) &
gfortran 4.2.1 (locally built from source).  Perhaps a gfortran
library issue?

Regards,
Michael S. Noble

--------------------------------------------------------------------

% uname -a
Linux rabble 2.6.18-5-amd64 #1 SMP Tue Oct 2 20:37:02 UTC 2007 x86_64 GNU/Linux

which g77 && g77 -v

        /usr/bin/g77

        Reading specs from /usr/lib/gcc/x86_64-linux-gnu/3.4.6/specs
        Configured with: ../src/configure -v
--enable-languages=c,c++,f77,pascal --prefix=/usr --libexecdir=/usr/lib
--with-gxx-include-dir=/usr/include/c++/3.4 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --program-suffix=-3.4
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
x86_64-linux-gnu
        Thread model: posix
        gcc version 3.4.6 (Debian 3.4.6-5)


g77 -o demo1-g77 -O2 demo1.f
time ./demo1-g77

        result = -0.690680921
        real     0m0.562s


g77 -o demo2-g77 -O2 demo2.f
time ./demo2-g77

         result = 1.57079501E+09
         real     0m0.041s


which gfortran && gfortran -v

        /usr/bin/gfortran

        Using built-in specs.
        Target: x86_64-linux-gnu
        Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release
x86_64-linux-gnu
        Thread model: posix
        gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

gfortran -o demo1-gfortran -O2 demo1.f
time ./demo1-gfortran

        result = -0.690680921077728
        real      0m7.681s

gfortran -o demo2-gfortran -O2 demo2.f
time ./demo2-gfortran

         result = 1570795008.00000
         real     0m2.085s


\rm demo?-gfortran
PATH=/usr/local/bin:$PATH
which gfortran && gfortran -v

        /usr/local/bin/gfortran
        Using built-in specs.
        Target: x86_64-unknown-linux-gnu
        Configured with: ./configure --prefix=/usr/local
--enable-languages=c,c++,fortran
        Thread model: posix
        gcc version 4.2.1

gfortran -o demo1-gfortran -O2 demo1.f -L/usr/local/lib -Wl,-R/usr/local/lib
time ./demo1-gfortran

        result =  -0.690680921077728
        real    0m7.672s

gfortran -o demo2-gfortran -O2 demo2.f -L/usr/local/lib -Wl,-R/usr/local/lib
time ./demo2-gfortran

        result =    1570795008.00000
        real    0m2.085s


-- 
           Summary: slow gfortran 4.x (library?) compared to g77 3.4
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mnoble at space dot mit dot edu
 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=34128



More information about the Gcc-bugs mailing list