Following program fails to link with -std=f95 option, even though dimag() is
supported intrinsic function. It compiles, links fine without -std or with
-std=gnu option.

$ cat dimag.f90
program test_dimag
        complex(8)  c8
        real*8 result

         c8 = cmplx(1.e0_8, 0.e0_8)
         print *, dimag(c8)

end program test_dimag

$ gfortran -std=f95 dimag.f90
/tmp/cc0aHEPk.o: In function `MAIN__':
dimag.f90:(.text+0x74): undefined reference to `dimag_'
collect2: ld returned 1 exit status

$ gfortran -v
Using built-in specs.
Target: powerpc64-linux
Configured with: /home/gccbuild/gcc_mline_anoncvs/gcc/configure
--prefix=/opt/gcc-nightly/mline-20051018 --build=powerpc64-linux
--host=powerpc64-linux --target=powerpc64-linux --with-cpu=default32
--with-as=/opt/gcc-nightly/mline-20051018/bin/as
--with-ld=/opt/gcc-nightly/mline-20051018/bin/ld --enable-threads=posix
--enable-shared --enable-__cxa_atexit
--enable-languages=c,c++,f95,java,objc,obj-c++ --enable-checking
--with-mpfr=/opt/gcc-nightly/mline-20051018
Thread model: posix
gcc version 4.1.0 20051018 (experimental)


-- 
           Summary: dimag_ undefined error with -std=f95
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uttamp at us dot ibm dot com
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24447

Reply via email to