gfortran45 IEEE exceptions are in the manual, but not supported?

Anton Shterenlikht mexas@bristol.ac.uk
Wed Feb 23 14:13:00 GMT 2011


On Wed, Feb 23, 2011 at 02:44:33PM +0100, Tobias Burnus wrote:
> Anton Shterenlikht wrote:
> > On ia64 FreeBSD 9.0-current:
> [...]
> > Fortran runtime warning: IEEE 'invalid operation' exception not supported.
> [...]
> > I understand that IEEE fpe are not implemented yet in gfortran.
> > Should then the reference to -ffpe-trap be removed from
> > the man page?
> 
> Don't assume that everything which does not work on
> ia64 FreeBSD doesn't work elsewhere ...
> 
> I think the required bits are missing from
>   ./libgfortran/config/*
> for for FreeBSD ia64.
> 
> There seems to be a version for x86_64 and 32-bit x86; there
> seems to be also a version for GLIBC. Thus, you could check
> whether you could adapt either version to work with FreeBSD
> on ia64. And there is a version which uses fpsetmask (fpu-sysv). 

This is way above my skills.
I can try asking Gerald@FreeBSD for help.

> As a first step you could check the configure logs to see what
> configure detects and whether, e.g., one of the existing
> fpu-* files would work.

This I probably could do..

> There is definitely the willingness to support also those
> platforms and fix problems, but users on and developers for
> those systems are expected to help doing so.

Just to report for now:

FreeBSD sparc64:

QOF> gfortran45 -v
Using built-in specs.
COLLECT_GCC=gfortran45
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc45/gcc/sparc64-portbld-freebsd9.0/4.5.3/lto-wrapper
Target: sparc64-portbld-freebsd9.0
Configured with: ./../gcc-4.5-20110210/configure --enable-lto=no --disable-nls --libdir=/usr/local/lib/gcc45 --libexecdir=/usr/local/libexec/gcc45 --program-suffix=45 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc45/include/c++/ --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local --with-system-zlib --disable-libgcj --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc45 --build=sparc64-portbld-freebsd9.0
Thread model: posix
gcc version 4.5.3 20110210 (prerelease) (GCC) 

QOF> gfortran46 -v
Using built-in specs.
COLLECT_GCC=gfortran46
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/sparc64-portbld-freebsd9.0/4.6.0/lto-wrapper
Target: sparc64-portbld-freebsd9.0
Configured with: ./../gcc-4.6-20110212/configure --enable-lto=no --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-libiconv-prefix=/usr/local --with-system-zlib --disable-libgcj --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=sparc64-portbld-freebsd9.0
Thread model: posix
gcc version 4.6.0 20110212 (experimental) (GCC) 

QOF> gfortran46 -Wl,-rpath=/usr/local/lib/gcc46/ -ffpe-trap=underflow,overflow,zero,denormal,invalid,precision ieee-except.f90

QOF> ./a.out 
Fortran runtime warning: IEEE 'invalid operation' exception not supported.
Fortran runtime warning: IEEE 'denormal number' exception not supported.
Fortran runtime warning: IEEE 'division by zero' exception not supported.
Fortran runtime warning: IEEE 'overflow' exception not supported.
Fortran runtime warning: IEEE 'underflow' exception not supported.
Fortran runtime warning: IEEE 'loss of precision' exception not supported.
   0.0000000    
        Infinity


And on a linux box:


bluecrystal1% gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/exports/gpfs/usrlocal/gcc-4.5/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.5-20100325/configure --prefix=/usr/local/gcc-4.5 --enable-languages=c,c++,fortran --with-mpfr=/usr/local/gcc-4.5 --with-mpfr-include=/usr/local/gcc-4.5/include --with-mpfr-lib=/usr/local/gcc-4.5/lib --with-gmp=/usr/local/gcc-4.5 --with-gmp-include=/usr/local/gcc-4.5/include --with-gmp-lib=/usr/local/gcc-4.5/lib --with-mpc=/usr/local/gcc-4.5 --with-mpc-include=/usr/local/gcc-4.5/include --with-mpc-lib=/usr/local/gcc-4.5/lib
Thread model: posix
gcc version 4.5.0 20100325 (experimental) (GCC) 

bluecrystal1% gfortran -ffpe-trap=underflow,overflow,denormal,zero,invalid,precision ieee-except.f90

bluecrystal1% ./a.out
Fortran runtime warning: IEEE 'denormal number' exception not supported.
Floating exception


Many thanks
Anton

-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 331 5944
Fax: +44 (0)117 929 4423



More information about the Fortran mailing list