[RFC] Quad-float support in Fortran

Angelo Graziosi angelo.graziosi@alice.it
Sun Nov 7 12:04:00 GMT 2010


Il 07/11/2010 11.49, Tobias Burnus ha scritto:
> Hi Angelo,
>
> Angelo Graziosi wrote:
>> Now, I can build gfortran (rev. 166408+your patches), whose result is:
>>
>> $ gfortran-4.6 -v
>> Target: i686-pc-cygwin
>> gcc version 4.6.0 20101106 (experimental) (GCC)
>>
>> With it I can compile this simple test case:
>> But:
>> $ ./test_qp
>> Segmentation fault (core dumped)
>
> It works here (x86-64-linux) without any problems. Can you compile with
> debugging symbols (-g), run it in a debugger and show the backtrace?
> Example
> gdb --quiet ./test_qp
> (gdb) run
> ...
> (gdb) bt

This is the result:

-------------------------------
$ gfortran-4.6 -g test_qp.f90 -o test_qp-new

$ gdb --quiet ./test_qp-new.exe
(gdb) run
Starting program: /tmp/applications/QP_testing/test_qp-new.exe
[New thread 3772.0xed4]
[New thread 3772.0xa10]

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x004203d9 in write_float ()
#2  0x00413ad0 in _gfortrani_write_real ()
#3  0x0040e934 in _gfortrani_list_formatted_write ()
#4  0x0022cb80 in ?? ()
#5  0x00423000 in ?? ()
#6  0x00000010 in ?? ()
#7  0x610ccfd5 in sys_cp_mbstowcs () from /usr/bin/cygwin1.dll
#8  0xea894c24 in ?? ()
#9  0xdde8d889 in ?? ()
#10 0xeb000134 in ?? ()
#11 0x244c8b86 in ?? ()
#12 0x89ea894c in ?? ()
#13 0x335ee8d8 in ?? ()
#14 0x74e90001 in ?? ()
#15 0x83ffffff in ?? ()
#16 0x20bafde0 in ?? ()
#17 0x88000000 in ?? ()
#18 0x00008883 in ?? ()
#19 0xe8d88900 in ?? ()
#20 0x00011434 in ?? ()
#21 0xffff31e9 in ?? ()
#22 0x047b83ff in ?? ()
---Type <return> to continue, or q <return> to quit---
#23 0x0b840f00 in ?? ()
#24 0x8bffffff in ?? ()
#25 0x42d15415 in ?? ()
#26 0x89c93100 in ?? ()
#27 0x89102444 in ?? ()
#28 0x8b182454 in ?? ()
#29 0x42d15815 in ?? ()
#30 0x24548900 in ?? ()
#31 0x244c391c in ?? ()
#32 0x038e0f18 in ?? ()
#33 0x8bffffff in ?? ()
#34 0x0f1c2444 in ?? ()
#35 0x8b0814be in ?? ()
#36 0x89102444 in ?? ()
#37 0xc1838814 in ?? ()
#38 0x90e2eb01 in ?? ()
#39 0x90909090 in ?? ()
#40 0x90909090 in ?? ()
#41 0x90909090 in ?? ()
#42 0x8b1cec83 in ?? ()
#43 0x89202444 in ?? ()
#44 0x8b14245c in ?? ()
#45 0x8924245c in ?? ()
---Type <return> to continue, or q <return> to quit---
#46 0x83182474 in ?? ()
#47 0x187610f8 in ?? ()
#48 0x042444c7 in ?? ()
#49 0x004272b7 in options.10.1495 ()
#50 0x002404c7 in ?? ()
#51 0xe8000000 in ?? ()
#52 0xfffff894 in ?? ()
#53 0x0026748d in ?? ()
#54 0xc88524ff in ?? ()
#55 0x8d004272 in ?? ()
#56 0x00008534 in ?? ()
#57 0x01b90000 in ?? ()
#58 0xb8000000 in ?? ()
#59 0x00000001 in ?? ()
#60 0xb68dd231 in ?? ()
#61 0x00000000 in ?? ()
(gdb)
-------------------------------

For completeness,

-------------------------------
$ cat test_qp-new.exe.stackdump
Exception: STATUS_ACCESS_VIOLATION at eip=00000000
eax=00000025 ebx=0022CB1C ecx=0022CAB1 edx=3FFBFBE7 esi=00000026 
edi=00000020
ebp=3FFBFBE7 esp=0022C99C 
program=C:\cygwin-2\tmp\applications\QP_testing\test_qp-new.exe, pid 
704, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
       2 [main] test_qp-new 704 exception::handle: Error while dumping 
state (probably corrupted stack)
-------------------------------

>
> Does the program work, if you compile it statically (-static)?

Really, if you re-read my OP, I have compiled the test statically... 
anyway, there is no difference (with the current patches there is not 
cygquad-0.dll)

>
> I wonder whether it has to do with the weakref. Can you search in your
> build directory for libgfortran's config.h. In my case it is at:

In my case,

$ grep SUPPOR gcc-4.6-r166408/Work/i686-pc-cygwin/libgfortran/config.h
#define SUPPORTS_WEAK 1

Ciao,
Angelo.

>
> ./x86_64-unknown-linux-gnu/32/libgfortran/config.h
> ./x86_64-unknown-linux-gnu/libgfortran/config.h
>
> I am in particular interested in the value for:
>
> /* Define to 1 if the target supports #pragma weak */
> #define SUPPORTS_WEAK 1
>
>
> Tobias



More information about the Gcc-patches mailing list