[RFC] Quad-float support, round 4

Steve Kargl sgk@troutmask.apl.washington.edu
Tue Sep 14 17:54:00 GMT 2010


On Tue, Sep 14, 2010 at 06:34:44PM +0200, Angelo Graziosi wrote:
> Il 14/09/2010 9.29, FX ha scritto:
> >>I have tried the same on Cygwin but...
> >>
> >>$ gcc-4.6 -x c -E timing.pf90 -o timing.f90&&  gfortran-4.6 
> >>-ffree-line-length-none -fno-whole-file timing.f90 -L/tmp/libquad/lib 
> >>-lgfortran -lquad -lm -O2&&  ./a.exe
> >>
> >>/tmp/ccwu3X12.o:timing.f90:(.text+0x8c4): undefined reference to `_sinl'
> >>/tmp/ccwu3X12.o:timing.f90:(.text+0xe84): undefined reference to `_cosl'
> >>/tmp/ccwu3X12.o:timing.f90:(.text+0x1444): undefined reference to 
> >>`_asinhl'
> >>/tmp/ccwu3X12.o:timing.f90:(.text+0x1a04): undefined reference to `_erfcl'
> >
> >Cygwin doesn't have long double, a.k.a. real(kind=10), math library 
> >support. Remove all lines that use this kind value.
> 
> Hmm... perhaps I am missing something...
> 
> $ cat test_qp.f90
> program test_qp
>   implicit none
>   integer, parameter :: QP = 10
>   real(QP), parameter :: Z1 = 1,HALF_PI = asin(Z1),PI = HALF_PI+HALF_PI

Yes, you are missing something.  The above line allows 
gfortran to constant fold all of the intrinsic procedures
that you invoke below, so you never actually need to 
link to anything in libm (and maybe libquad depending on
how FX has the frontend handle constant folding).  You
can check whether folding is occurrnig or not by using
-fdump-tree-original.

-- 
steve



More information about the Fortran mailing list