This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, libfortran] PR 48977 -ffpe-trap=denormal on glibc systems
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Fortran List <fortran at gcc dot gnu dot org>
- Date: Fri, 20 May 2011 16:28:07 +0300
- Subject: [Patch, libfortran] PR 48977 -ffpe-trap=denormal on glibc systems
Hi,
the attached patch makes libgfortran prefer the x86 asm implementation
of setting FPU traps instead of using glibc feenableexcept(). This
enables to trap on denormals, which glibc doesn't support. Contrary to
the original patch in the PR, this swaps only glibc and x86
priorities, as using the x86 implementation on Solaris can cause
debugging issues.
However, due to the fpu-sysv implementation apparently being broken
(PR 48982) Solaris will so far use the x86 implementation as it has
done for a long time (that is, this patch should not introduce any new
breakage on Solaris). But once 48982 is fixed, this problem should be
taken care of as well.
Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
2011-05-20 Janne Blomqvist <jb@gcc.gnu.org>
Uros Bizjak <ubizjak@gmail.com>
PR libfortran/48977
* configure.host: Swap order of glibc and x86 tests.
--
Janne Blomqvist
diff --git a/libgfortran/configure.host b/libgfortran/configure.host
index eb68c93..92b6433 100644
--- a/libgfortran/configure.host
+++ b/libgfortran/configure.host
@@ -20,17 +20,17 @@
# DEFAULTS
fpu_host='fpu-generic'
-# HOST-SPECIFIC OVERRIDES
+if test "x${have_feenableexcept}" = "xyes"; then
+ fpu_host='fpu-glibc'
+fi
+
+# x86 asm should be used instead of glibc, since glibc doesn't support
+# the x86 denormal exception.
case "${host_cpu}" in
i?86 | x86_64)
fpu_host='fpu-387' ;;
esac
-# CONFIGURATION-SPECIFIC OVERRIDES
-if test "x${have_feenableexcept}" = "xyes"; then
- fpu_host='fpu-glibc'
-fi
-
if test "x${have_fpsetmask}" = "xyes"; then
fpu_host='fpu-sysv'
fi