This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Quad-float support in Fortran


Il 07/11/2010 9.30, Tobias Burnus ha scritto:
Tobias Burnus wrote:
On October 27, 2010 23:47, FX wrote:
The attached patch is the current state of my quad-float patch for
gfortran.
Changes relative to FX's patch:

As Angelo mentioned, I forgot to include libgfortran.spec.in.


Tobias

Now, I can build gfortran (rev. 166408+your patches), whose result is:


$ gfortran-4.6 -v
Driving: gfortran-4.6 -v -specs=libgfortran.spec
Using built-in specs.
Reading specs from /usr/local/gfortran/lib/gcc/i686-pc-cygwin/4.6.0/../../../libgfortran.spec
rename spec lib to liborig
COLLECT_GCC=gfortran-4.6
COLLECT_LTO_WRAPPER=/usr/local/gfortran/libexec/gcc/i686-pc-cygwin/4.6.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /tmp/gcc-4.6-r166408/configure --prefix=/usr/local/gfortran --program-suffix=-4.6 --enable-languages=c,c++,fortran --enable-checking=release --enable-threads=posix --enable-libgomp --disable-bootstrap --disable-libmudflap --disable-shared
Thread model: posix
gcc version 4.6.0 20101106 (experimental) (GCC)


With it I can compile this simple test case:

$ cat test_qp.f90
program test_qp
  implicit none
  integer, parameter :: QP = 16
  real(QP), parameter :: Z1 = 1,HALF_PI = asin(Z1),PI = HALF_PI+HALF_PI
  real(QP) :: x = 0.124_QP
  print *, x
  print *, PI
  print *, 16*atan(0.2_QP)-4*atan(Z1/239)
  print *, sin(PI)
  print *, cos(HALF_PI)
  print *, asinh(PI)
  print *, erfc(Z1)
  print *, epsilon(x)
  print *, precision(x)
  print *, digits(x)
end program test_qp

with

$ gfortran-4.6 -static test_qp.f90 -o test_qp

But:

$ ./test_qp
Segmentation fault (core dumped)

If I use my previous build (a week ago) of gfortran (done with round4 patches, in the old way [*]), it works just fine:

$ /usr/local/gfortran-save/bin/gfortran-4.6.exe -v
Using built-in specs.
COLLECT_GCC=/usr/local/gfortran-save/bin/gfortran-4.6
COLLECT_LTO_WRAPPER=/usr/local/gfortran-save/bin/../libexec/gcc/i686-pc-cygwin/4.6.0/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /tmp/gcc-4.6-r166096/configure --prefix=/usr/local/gfortran --program-suffix=-4.6 --enable-languages=c,c++,fortran --enable-checking=release --enable-threads=posix --enable-libgomp --disable-bootstrap --disable-libmudflap --disable-shared --with-quad=/tmp/libquad
Thread model: posix
gcc version 4.6.0 20101030 (experimental) (GCC)



$ gfortran-4.6 -static test_qp.f90 -o test_qp -L/tmp/libquad/lib -lgfortran -lquad


$ ./test_qp.exe
  0.12399999999999999999999999999999999
   3.1415926535897932384626433832795028
   3.1415926535897932384626433832795032
  8.67181013012378102479704402604335225E-0035
  4.33590506506189051239852201302167613E-0035
   1.8622957433108482198883613251826206
  0.15729920705028513065877936491739074
  1.92592994438723585305597794258492732E-0034
          33
         113


All this occurs on Cygwin.


Ciao,
Angelo.

---
[*] http://gcc.gnu.org/ml/fortran/2010-09/msg00284.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]