Patchwork [testsuite] Compile gfortran.dg/fmt_g0_6.f08 with -ffloat-store

login
register
mail settings
Submitter Rainer Orth
Date May 2, 2011, 2:20 p.m.
Message ID <ydd1v0hi3pj.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/93665/
State New
Headers show

Comments

Rainer Orth - May 2, 2011, 2:20 p.m.
gfortran.dg/fmt_g0_6.f08 execution seems to fail on all 32-bit x86
targets at -O1 and above.  Running it under gdb, I find

Program received signal SIGABRT, Aborted.
[Switching to Thread 1 (LWP 1)]
0xfed0ff85 in _lwp_kill () from /lib/libc.so.1
(gdb) where
#0  0xfed0ff85 in _lwp_kill () from /lib/libc.so.1
#1  0xfed08f49 in thr_kill () from /lib/libc.so.1
#2  0xfecb8f3d in raise () from /lib/libc.so.1
#3  0xfec9114d in abort () from /lib/libc.so.1
#4  0xfef43b2c in _gfortran_abort () at /vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/abort.c:34
#5  0x08051821 in check_f_fmt (val=0.995, roundmode=..., w=15, d=2, e=0, _roundmode=1) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:76
#6  main (val=Could not find the frame base for "main".
) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:26
#7  0x0805185b in check_all (val=0.995, w=15, d=2, e=0) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:21
#8  main (val=0.995, w=15, d=2, e=Could not find the frame base for "main".
) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:15
#9  0x08051923 in test_g0fr (argc=1, argv=0x8047a70 "/vol/gcc/obj/regression/trunk/11-gcc/build/gcc/testsuite/gfortran/fmt_g0_6.exe") at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:11
#10 main (argc=1, argv=0x8047a70 "/vol/gcc/obj/regression/trunk/11-gcc/build/gcc/testsuite/gfortran/fmt_g0_6.exe") at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:13
#11 0x08050f03 in _start ()

        if (s_g /= s_f) call abort

(gdb) p s_g
$1 = ''        1.0    '', ' ' <repeats 63 times>
(gdb) p s_f
$2 = ''       0.99    '', ' ' <repeats 63 times>

The failure vanishes with -ffloat-store, so I propose the following
patch, tested on i386-pc-solaris2.11 with the appropriate runtest
invocation.

Ok for mainline?

	Rainer


2011-04-30  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gfortran.dg/fmt_g0_6.f08: Use dg-options "-ffloat-store".
        Fix typo.
Jerry DeLisle - May 3, 2011, 12:54 a.m.
On 05/02/2011 07:20 AM, Rainer Orth wrote:
> gfortran.dg/fmt_g0_6.f08 execution seems to fail on all 32-bit x86
> targets at -O1 and above.  Running it under gdb, I find
>
> Program received signal SIGABRT, Aborted.
> [Switching to Thread 1 (LWP 1)]
> 0xfed0ff85 in _lwp_kill () from /lib/libc.so.1
> (gdb) where
> #0  0xfed0ff85 in _lwp_kill () from /lib/libc.so.1
> #1  0xfed08f49 in thr_kill () from /lib/libc.so.1
> #2  0xfecb8f3d in raise () from /lib/libc.so.1
> #3  0xfec9114d in abort () from /lib/libc.so.1
> #4  0xfef43b2c in _gfortran_abort () at /vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/abort.c:34
> #5  0x08051821 in check_f_fmt (val=0.995, roundmode=..., w=15, d=2, e=0, _roundmode=1) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:76
> #6  main (val=Could not find the frame base for "main".
> ) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:26
> #7  0x0805185b in check_all (val=0.995, w=15, d=2, e=0) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:21
> #8  main (val=0.995, w=15, d=2, e=Could not find the frame base for "main".
> ) at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:15
> #9  0x08051923 in test_g0fr (argc=1, argv=0x8047a70 "/vol/gcc/obj/regression/trunk/11-gcc/build/gcc/testsuite/gfortran/fmt_g0_6.exe") at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:11
> #10 main (argc=1, argv=0x8047a70 "/vol/gcc/obj/regression/trunk/11-gcc/build/gcc/testsuite/gfortran/fmt_g0_6.exe") at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/fmt_g0_6.f08:13
> #11 0x08050f03 in _start ()
>
>          if (s_g /= s_f) call abort
>
> (gdb) p s_g
> $1 = ''        1.0    '', ' '<repeats 63 times>
> (gdb) p s_f
> $2 = ''       0.99    '', ' '<repeats 63 times>
>
> The failure vanishes with -ffloat-store, so I propose the following
> patch, tested on i386-pc-solaris2.11 with the appropriate runtest
> invocation.
>
> Ok for mainline?
>

This is OK.  We are working on a solution, so maybe it would be better to XFAIL 
it so that when it does get fixed it will be flagged. It also fails on i686-pc-gnu.

Regards,

Jerry
Rainer Orth - May 3, 2011, 8:50 a.m.
Jerry,

>> The failure vanishes with -ffloat-store, so I propose the following
>> patch, tested on i386-pc-solaris2.11 with the appropriate runtest
>> invocation.
>>
>> Ok for mainline?
>
> This is OK.  We are working on a solution, so maybe it would be better to
> XFAIL it so that when it does get fixed it will be flagged. It also fails
> on i686-pc-gnu.

is this a solution for this particular case or for the general need to
sometimes use -ffloat-store?  In the former case, I'd agree, in the
latter it's probably better to consistently use -ffloat-store in the
testcases and review those uses once a solution is in place.

I also saw the same failure on 32-bit Linux/x86, so the XFAIL would have
to be for { i?86-*-* x86_64-*-* } && ilp32.

Let me know what you prefer.

Thanks.
	Rainer

Patch

diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_6.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_6.f08
--- a/gcc/testsuite/gfortran.dg/fmt_g0_6.f08
+++ b/gcc/testsuite/gfortran.dg/fmt_g0_6.f08
@@ -1,4 +1,5 @@ 
 ! { dg-do run }
-! PE48602 Invalid F conversion of G descriptor for values close to powers of 10
+! { dg-options "-ffloat-store" }
+ ! PR48602 Invalid F conversion of G descriptor for values close to powers of 10
 ! Test case provided by Thomas Henlich
 program test_g0fr