Bug 56204 - [4.8 regression] gfortran.dg/quad_[23].f90 FAIL on Solaris 9/x86
Summary: [4.8 regression] gfortran.dg/quad_[23].f90 FAIL on Solaris 9/x86
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-04 13:31 UTC by Rainer Orth
Modified: 2013-02-14 10:13 UTC (History)
1 user (show)

See Also:
Host: i386-pc-solaris2.9
Target: i386-pc-solaris2.9
Build: i386-pc-solaris2.9
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Orth 2013-02-04 13:31:56 UTC
Since about 20121205, the quad_[23].f90 execution tests started to FAIL on
Solaris 9/x86:


FAIL: gfortran.dg/quad_2.f90  -O0  execution test
FAIL: gfortran.dg/quad_2.f90  -O1  execution test
FAIL: gfortran.dg/quad_2.f90  -O2  execution test
FAIL: gfortran.dg/quad_2.f90  -O3 -fomit-frame-pointer  execution test
FAIL: gfortran.dg/quad_2.f90  -O3 -fomit-frame-pointer -funroll-loops  execution test
FAIL: gfortran.dg/quad_2.f90  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  execution test
FAIL: gfortran.dg/quad_2.f90  -O3 -g  execution test
FAIL: gfortran.dg/quad_2.f90  -Os  execution test
FAIL: gfortran.dg/quad_3.f90  -O0  execution test
FAIL: gfortran.dg/quad_3.f90  -O1  execution test
FAIL: gfortran.dg/quad_3.f90  -O2  execution test
FAIL: gfortran.dg/quad_3.f90  -O3 -fomit-frame-pointer  execution test
FAIL: gfortran.dg/quad_3.f90  -O3 -fomit-frame-pointer -funroll-loops  execution test
FAIL: gfortran.dg/quad_3.f90  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  execution test
FAIL: gfortran.dg/quad_3.f90  -O3 -g  execution test
FAIL: gfortran.dg/quad_3.f90  -Os  execution test

It aborts here:

Program received signal SIGABRT, Aborted.
0xb5b23b96 in _libc_kill () from /usr/lib/libc.so.1
(gdb) where
#0  0xb5b23b96 in _libc_kill () from /usr/lib/libc.so.1
#1  0xb5ad7dbe in raise () from /usr/lib/libc.so.1
#2  0xb5ac03fe in abort () from /usr/lib/libc.so.1
#3  0xb5c54714 in _gfortrani_sys_abort ()
    at /vol/gcc/src/hg/trunk/local/libgfortran/runtime/error.c:173
#4  0xb5d0f3b8 in _gfortran_abort ()
    at /vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/abort.c:33
#5  0x080511b2 in test_qp ()
    at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/quad_2.f90:34
#6  0x08051662 in main (argc=1, argv=0x8047a28)
    at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/quad_2.f90:78
#7  0x08050a1d in _start ()

The test is l.34:

34         if (fp2 /= fp4) call abort()

but unfortunately gdb 7.5 can read neither variable.

(gdb) p fp2
$1 = <error reading variable>
(gdb) p fp4
$2 = <error reading variable>

The quad_2.f90 is a regression from 4.7, the quad_3.f90 test wasn't present
there.

  Rainer
Comment 1 Tobias Burnus 2013-02-12 19:27:16 UTC
(In reply to comment #0)
> The test is l.34:
> 
> 34         if (fp2 /= fp4) call abort()
> but unfortunately gdb 7.5 can read neither variable.

Can you uncomment the existing "print" lines and add
  print *, fp2
  print *, fp4
before the abort line?

Probably, some rounding goes wrong - maybe replacing
  if (fp2 /= fp4) call abort()
by
  if (abs (fp2 - fp4)/fp2 > epsilon(fp2)) call abort()
works which allows for a minor deviation of the value.
Comment 2 ro@CeBiTec.Uni-Bielefeld.DE 2013-02-13 11:19:37 UTC
> --- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-12 19:27:16 UTC ---
> (In reply to comment #0)
>> The test is l.34:
>> 
>> 34         if (fp2 /= fp4) call abort()
>> but unfortunately gdb 7.5 can read neither variable.
>
> Can you uncomment the existing "print" lines and add
>   print *, fp2
>   print *, fp4
> before the abort line?

Sure, this way I get

>   1.00000000000000000000000000000000000<
>1.00000000000000000000000000000000000<
>   1.41421356237309504880168872420969798<
>1.41421356237309504880168872420969798<
   1.41421356237309504880168872420969798      
   1.41421356237309504880168872420969779      

> Probably, some rounding goes wrong - maybe replacing
>   if (fp2 /= fp4) call abort()
> by
>   if (abs (fp2 - fp4)/fp2 > epsilon(fp2)) call abort()
> works which allows for a minor deviation of the value.

This helps, but now we run into the next abort.  Adding another set of
print's shows

   1.41421356237309504880168872420969798      
   1.41421356237309504880168872420969779      

Changing the abort() conditions both times allows the test to pass, also
tested with the prints commented again and the appropriate runtest
invocation on i386-pc-solaris2.9, i386-pc-solaris2.10, and
x86_64-unknown-linux-gnu.

The quad_3.f90 test aborts here:

#5  0x080511b1 in test_qp ()
    at /vol/gcc/src/hg/trunk/local/gcc/testsuite/gfortran.dg/quad_3.f90:28
28           if (a-b(1) /= 0.0_qp .or. c-b(1) /= 0.0_qp) call abort()

Uncommenting the prints shows:

 same value read again:      1.18973149535723176508575932662800647E+0932   1.18973149535723176508575932662800647E+0932
 difference: looks OK now   -1.87718493982104061421441469311027910E+0898

	Rainer
Comment 3 Tobias Burnus 2013-02-13 12:03:27 UTC
Author: burnus
Date: Wed Feb 13 12:03:18 2013
New Revision: 196011

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196011
Log:
2013-02-13  Tobias Burnus  <burnus@net-b.de>
            Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

        PR fortran/56204
        * gfortran.dg/quad_2.f90: Use "< epsilon" instead of "==".
        * gfortran.dg/quad_3.f90: Ditto.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/quad_2.f90
    trunk/gcc/testsuite/gfortran.dg/quad_3.f90
Comment 4 Tobias Burnus 2013-02-13 12:06:02 UTC
Thanks for testing. It looks as if it should have been FIXED by the committed patch. Please re-open if the issue still occurs.
Comment 5 ro@CeBiTec.Uni-Bielefeld.DE 2013-02-14 10:13:03 UTC
> --- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-13 12:06:02 UTC ---
> Thanks for testing. It looks as if it should have been FIXED by the committed
> patch. Please re-open if the issue still occurs.

The test now passes on i386-pc-solaris2.9, i386-pc-solaris2.10, and
sparc-sun-solaris2.11.

Thanks.
        Rainer