This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2007 09:16:22 -0000
- Subject: [Bug libfortran/26253] fallback scalbn doesn't handle denormals correctly
- References: <bug-26253-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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