[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] branch main updated: Compile with -fexcess-precision=sta
From: |
Rob Browning |
Subject: |
[Guile-commits] branch main updated: Compile with -fexcess-precision=standard for i[3456]86 when we can |
Date: |
Sat, 05 Oct 2024 20:22:40 -0400 |
This is an automated email from the git hooks/post-receive script.
rlb pushed a commit to branch main
in repository guile.
The following commit(s) were added to refs/heads/main by this push:
new 9b1effb58 Compile with -fexcess-precision=standard for i[3456]86 when
we can
9b1effb58 is described below
commit 9b1effb58579821ffa9357df808d5264e45fb30c
Author: Rob Browning <rlb@defaultvalue.org>
AuthorDate: Sat Oct 5 17:18:06 2024 -0500
Compile with -fexcess-precision=standard for i[3456]86 when we can
* configure.ac: when -fexcess-precision=standard is available and we're
building for i[3456]86, use it. This fixes floating point precision
problems caused by x87 (80-bit) floating point, and detected by
numbers.test.
Closes: 43262
---
NEWS | 2 ++
configure.ac | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/NEWS b/NEWS
index b6566903b..9fd14c39d 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,8 @@ Changes in 3.0.11 (since 3.0.10)
(<https://bugs.gnu.org/71891>)
** Compiler no longer crashes when inlining 3.0.9 procedure with kw args
(<https://bugs.gnu.org/72936>)
+** Guile is compiled with -fexcess-precision=standard for i[3456]86 when
possible
+ (<https://debbugs.gnu.org/43262>)
Changes in 3.0.10 (since 3.0.9)
diff --git a/configure.ac b/configure.ac
index 262b171f1..ce3ae0226 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,30 @@ AC_PROG_INSTALL
AC_PROG_CC
gl_EARLY
+AC_MSG_CHECKING([whether the compiler supports -fexcess-precision=standard])
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fexcess-precision=standard"
+fexcess_precision=''
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo;], [])], [fexcess_precision=1]])
+CFLAGS="$old_CFLAGS"
+if test -n "$fexcess_precision"; then
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+AC_MSG_CHECKING([whether we want -fexcess-precision=standard for $target_cpu])
+case "$target_cpu" in
+ i[[3456]]86)
+ AC_MSG_RESULT([yes])
+ if test -n "$fexcess_precision"; then
+ CFLAGS="$CFLAGS -fexcess-precision=standard"
+ else
+ AC_MSG_WARN([floating-point precision may exceed C99 rules])
+ fi
+ ;;
+ *) AC_MSG_RESULT([no]) ;;
+esac
+
AC_MSG_CHECKING([whether the compiler supports -flto])
old_CFLAGS="$CFLAGS"
LTO_CFLAGS="-flto"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] branch main updated: Compile with -fexcess-precision=standard for i[3456]86 when we can,
Rob Browning <=