public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution
@ 2006-02-13 3:37 danglin at gcc dot gnu dot org
2006-02-14 11:19 ` [Bug libfortran/26253] " fxcoudert at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: danglin at gcc dot gnu dot org @ 2006-02-13 3:37 UTC (permalink / raw)
To: gcc-bugs
Executing on host: /users/bin/gcc/gcc-4.1/objdir/gcc/testsuite/../gfortran
-B/us
ers/bin/gcc/gcc-4.1/objdir/gcc/testsuite/../
/users/bin/gcc/gcc-4.1/gcc/gcc/test
suite/gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 -w -O0
-L/
users/bin/gcc/gcc-4.1/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs
-L/users/b
in/gcc/gcc-4.1/objdir/hppa1.1-hp-hpux10.20/./libgfortran/.libs
-L/users/bin/gcc/
gcc-4.1/objdir/hppa1.1-hp-hpux10.20/./libiberty -lm -o
/users/bin/gcc/gcc-4.1
/objdir/gcc/testsuite/intrinsic_set_exponent.x (timeout = 600)
PASS: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 compilation,
-O0
Setting LD_LIBRARY_PATH to
.:/users/bin/gcc/gcc-4.1/objdir/hppa1.1-hp-hpux10.20/
./libgfortran/.libs:/users/bin/gcc/gcc-4.1/objdir/hppa1.1-hp-hpux10.20/./libgfor
tran/.libs:/users/bin/gcc/gcc-4.1/objdir/gcc:.:/users/bin/gcc/gcc-4.1/objdir/hpp
a1.1-hp-hpux10.20/./libgfortran/.libs:/users/bin/gcc/gcc-4.1/objdir/hppa1.1-hp-h
pux10.20/./libgfortran/.libs:/users/bin/gcc/gcc-4.1/objdir/gcc
FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution,
-O
0
Breakpoint 1, _gfortran_abort ()
at ../../../gcc/libgfortran/intrinsics/abort.c:38
38 close_units ();
(gdb) bt
#0 _gfortran_abort () at ../../../gcc/libgfortran/intrinsics/abort.c:38
#1 0x3e5c in test_real8_ ()
at
/users/bin/gcc/gcc-4.1/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_set_exponent.f90:59
#2 0x39e4 in MAIN__ ()
at
/users/bin/gcc/gcc-4.1/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_set_exponent.f90:5
#3 0x42bc in main (argc=1, argv=0x7b03b054)
at ../../../gcc/libgfortran/fmain.c:18
#4 0x7af1d86c in ?? () from /usr/lib/libc.1
(gdb) break intrinsic_set_exponent.f90:59
...
Breakpoint 2, test_real8_ ()
at
/users/bin/gcc/gcc-4.1/gcc/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_set_exponent.f90:59
59 if (y .ne. 128.0) call abort()
(gdb) p y
$1 = 128.00000000000003
It looks like the rounding error arises from the call to pow in scalbn.
This is the return value:
(gdb) info reg fr4
fr4 (single precision) 3.75
fr4 (double precision) 256.00000000000006
Not sure why, but the test doesn't fail when linked with -static. I also
can't duplicate with a simple test program.
--
Summary: FAIL: gfortran.fortran-
torture/execute/intrinsic_set_exponent.f90 execution
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: danglin at gcc dot gnu dot org
GCC build triplet: hppa1.1-hp-hpux10.20
GCC host triplet: hppa1.1-hp-hpux10.20
GCC target triplet: hppa1.1-hp-hpux10.20
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
@ 2006-02-14 11:19 ` fxcoudert at gcc dot gnu dot org
2006-02-14 14:15 ` dave at hiauly1 dot hia dot nrc dot ca
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-02-14 11:19 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from fxcoudert at gcc dot gnu dot org 2006-02-14 11:19 -------
This reminds me of PR25370... (for the -static effect).
I'm currently bootstrapping mainline on a hppa2.0w-hp-hpux11.23 (thanks to HP
testdrive) to nail down this one and PR26252. John, are those the only
hppa-hpux failures you see in the testsuite?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
2006-02-14 11:19 ` [Bug libfortran/26253] " fxcoudert at gcc dot gnu dot org
@ 2006-02-14 14:15 ` dave at hiauly1 dot hia dot nrc dot ca
2006-02-15 9:15 ` fxcoudert at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2006-02-14 14:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dave at hiauly1 dot hia dot nrc dot ca 2006-02-14 14:15 -------
Subject: Re: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90
execution
> This reminds me of PR25370... (for the -static effect).
>
> I'm currently bootstrapping mainline on a hppa2.0w-hp-hpux11.23 (thanks to HP
> testdrive) to nail down this one and PR26252. John, are those the only
> hppa-hpux failures you see in the testsuite?
Here are the failures that I see on hppa1.1-hp-hpu10.20:
http://gcc.gnu.org/ml/gcc-testresults/2006-02/msg00635.html
I don't see any failures at the moment on 4.1.0 on hppa2.0w-hp-hpux11.11.
See http://gcc.gnu.org/ml/gcc-testresults/2006-02/msg00637.html
hpux10.20 doesn't have scalbn and hpux11.x does, so that's one difference.
The problem appears to be with the pow function called from the libgfortran
version of scalbn. I had looked at the arguments in the call to pow
in scalbn and they appear fine. However, the return contains a small
rounding error. I didn't see the same rounding error when I wrote a
little test program to try duplicate the effect.
Possibly, the default rounding mode is somehow getting changed in
the test program. scalbn is called several times before the error
occurs.
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
2006-02-14 11:19 ` [Bug libfortran/26253] " fxcoudert at gcc dot gnu dot org
2006-02-14 14:15 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2006-02-15 9:15 ` fxcoudert at gcc dot gnu dot org
2006-02-17 20:33 ` [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly fxcoudert at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-02-15 9:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from fxcoudert at gcc dot gnu dot org 2006-02-15 09:15 -------
(In reply to comment #2)
> hpux10.20 doesn't have scalbn and hpux11.x does, so that's one difference.
On hppa2.0w-hp-hpux11.23, I see this same bug if I undefine HAVE_SCALBN in
libgfortran/config.h. I'll look into it sometime tonight or tomorrow.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-02-15 09:15:24
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-02-15 9:15 ` fxcoudert at gcc dot gnu dot org
@ 2006-02-17 20:33 ` fxcoudert at gcc dot gnu dot org
2007-01-07 0:56 ` danglin at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-02-17 20:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from fxcoudert at gcc dot gnu dot org 2006-02-17 20:33 -------
This is a problem in libgfortran scalbn fallback version not handling correctly
denormals. A i686-linux testcase is included below. I switch this to severity
"minor".
$ cat a.c
#include <stdio.h>
#include <math.h>
double
gfortran_scalbn(double x, int y)
{
static double two = 2;
return x * pow(two, y);
}
int main (void)
{
double x, y;
int n, dummy;
n = 1024;
x = 2.22507385850720088902458687608585988765042311224e-308;
y = gfortran_scalbn (frexp (x, &dummy), n);
printf ("%lg\n", y);
return 0;
}
$ gcc a.c -lm && ./a.out
inf
If we use the libm scalbn instead (at least on i686-linux), the result printed
is 1.79769e+308.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
GCC build triplet|hppa1.1-hp-hpux10.20 |
GCC host triplet|hppa1.1-hp-hpux10.20 |
GCC target triplet|hppa1.1-hp-hpux10.20 |
Last reconfirmed|2006-02-15 09:15:24 |2006-02-17 20:33:15
date| |
Summary|FAIL: gfortran.fortran- |fallback scalbn doesn't
|torture/execute/intrinsic_se|handle denormals correctly
|t_exponent.f90 execution |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-02-17 20:33 ` [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly fxcoudert at gcc dot gnu dot org
@ 2007-01-07 0:56 ` danglin at gcc dot gnu dot org
2007-09-19 9:16 ` fxcoudert at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu dot org @ 2007-01-07 0:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from danglin at gcc dot gnu dot org 2007-01-07 00:55 -------
This failure also occurs in 4.0.3 hppa1.1-hp-hpux10.20.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (4 preceding siblings ...)
2007-01-07 0:56 ` danglin at gcc dot gnu dot org
@ 2007-09-19 9:16 ` fxcoudert at gcc dot gnu dot org
2007-09-20 2:24 ` dave at hiauly1 dot hia dot nrc dot ca
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-19 9:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from fxcoudert at gcc dot gnu dot org 2007-09-19 09:16 -------
For some reason, I had completely forgotten about ldexp(). But as it is C89, it
should be available, and as all GCC supported targets now have (FLT_RADIX ==
2), it should fix the problem. John, could you confirm that the following patch
fixes the testsuite failure?
Index: libgfortran/intrinsics/c99_functions.c
===================================================================
--- libgfortran/intrinsics/c99_functions.c (revision 128540)
+++ libgfortran/intrinsics/c99_functions.c (working copy)
@@ -341,7 +341,11 @@ log10f(float x)
double
scalbn(double x, int y)
{
+#if (FLT_RADIX == 2) && defined(HAVE_LDEXP)
+ return ldexp (x, y);
+#else
return x * pow(FLT_RADIX, y);
+#endif
}
#endif
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Keywords| |patch
Last reconfirmed|2006-02-17 20:33:15 |2007-09-19 09:16:22
date| |
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (5 preceding siblings ...)
2007-09-19 9:16 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-20 2:24 ` dave at hiauly1 dot hia dot nrc dot ca
2007-09-21 10:54 ` fxcoudert at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2007-09-20 2:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dave at hiauly1 dot hia dot nrc dot ca 2007-09-20 02:24 -------
Subject: Re: fallback scalbn doesn't handle denormals correctly
> For some reason, I had completely forgotten about ldexp(). But as it is C89, it
> should be available, and as all GCC supported targets now have (FLT_RADIX ==
> 2), it should fix the problem. John, could you confirm that the following patch
> fixes the testsuite failure?
Testing is underway but this looks close to obvious. From the HP-UX 11.11
manpage for scalbn:
The scalbn() function returns x * r**n, where r is the radix of the
machine's floating-point arithmetic. When r is 2 (as it is on all
PA-RISC systems), scalbn() is equivalent to ldexp().
Thanks,
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (6 preceding siblings ...)
2007-09-20 2:24 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2007-09-21 10:54 ` fxcoudert at gcc dot gnu dot org
2007-09-21 10:55 ` fxcoudert at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-21 10:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from fxcoudert at gcc dot gnu dot org 2007-09-21 10:54 -------
Subject: Bug 26253
Author: fxcoudert
Date: Fri Sep 21 10:54:20 2007
New Revision: 128648
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128648
Log:
PR libfortran/26253
* intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate.
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/intrinsics/c99_functions.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (7 preceding siblings ...)
2007-09-21 10:54 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-21 10:55 ` fxcoudert at gcc dot gnu dot org
2008-01-21 17:41 ` danglin at gcc dot gnu dot org
2008-01-21 18:34 ` danglin at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-21 10:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from fxcoudert at gcc dot gnu dot org 2007-09-21 10:55 -------
This should now be fixed. Please reopen if I fumbled in any way and the issue
is still present.
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (8 preceding siblings ...)
2007-09-21 10:55 ` fxcoudert at gcc dot gnu dot org
@ 2008-01-21 17:41 ` danglin at gcc dot gnu dot org
2008-01-21 18:34 ` danglin at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu dot org @ 2008-01-21 17:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from danglin at gcc dot gnu dot org 2008-01-21 17:25 -------
Subject: Bug 26253
Author: danglin
Date: Mon Jan 21 17:24:30 2008
New Revision: 131698
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131698
Log:
PR libfortran/34699
Backport:
2007-09-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/26253
* intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate.
Modified:
branches/gcc-4_2-branch/libgfortran/ChangeLog
branches/gcc-4_2-branch/libgfortran/intrinsics/c99_functions.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
` (9 preceding siblings ...)
2008-01-21 17:41 ` danglin at gcc dot gnu dot org
@ 2008-01-21 18:34 ` danglin at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu dot org @ 2008-01-21 18:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from danglin at gcc dot gnu dot org 2008-01-21 18:13 -------
Subject: Bug 26253
Author: danglin
Date: Mon Jan 21 18:13:04 2008
New Revision: 131699
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131699
Log:
PR libfortran/34699
Backport:
2007-09-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/26253
* intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate.
Modified:
branches/gcc-4_1-branch/libgfortran/ChangeLog
branches/gcc-4_1-branch/libgfortran/intrinsics/c99_functions.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26253
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-01-21 18:14 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-13 3:37 [Bug libfortran/26253] New: FAIL: gfortran.fortran-torture/execute/intrinsic_set_exponent.f90 execution danglin at gcc dot gnu dot org
2006-02-14 11:19 ` [Bug libfortran/26253] " fxcoudert at gcc dot gnu dot org
2006-02-14 14:15 ` dave at hiauly1 dot hia dot nrc dot ca
2006-02-15 9:15 ` fxcoudert at gcc dot gnu dot org
2006-02-17 20:33 ` [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly fxcoudert at gcc dot gnu dot org
2007-01-07 0:56 ` danglin at gcc dot gnu dot org
2007-09-19 9:16 ` fxcoudert at gcc dot gnu dot org
2007-09-20 2:24 ` dave at hiauly1 dot hia dot nrc dot ca
2007-09-21 10:54 ` fxcoudert at gcc dot gnu dot org
2007-09-21 10:55 ` fxcoudert at gcc dot gnu dot org
2008-01-21 17:41 ` danglin at gcc dot gnu dot org
2008-01-21 18:34 ` danglin at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).