Patchwork [1/3] libgcc: check for fenv.h in dfp configure check

login
register
mail settings
Submitter aldot
Date April 4, 2013, 7:53 p.m.
Message ID <1365105210-16552-2-git-send-email-rep.dot.nop@gmail.com>
Download mbox | patch
Permalink /patch/233931/
State New
Headers show

Comments

aldot - April 4, 2013, 7:53 p.m.
uClibc can be built without fenv support, extend the configure check for
decimal floating point to probe the existance of fenv.h, too.

libgcc/ChangeLog:

2013-03-24  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>

	* configure.ac (libgcc_cv_dfp): Extend check to probe fenv.h
	availability.
	* configure: Regenerate

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 libgcc/configure    |   13 +++++++++++++
 libgcc/configure.ac |    9 ++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)
Ian Taylor - April 4, 2013, 9:01 p.m.
On Thu, Apr 4, 2013 at 12:53 PM, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
>
> 2013-03-24  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
>
>         * configure.ac (libgcc_cv_dfp): Extend check to probe fenv.h
>         availability.
>         * configure: Regenerate

This is OK.

Thanks.

Ian
aldot - Nov. 8, 2013, 10:19 a.m.
On 4 April 2013 23:01, Ian Lance Taylor <iant@google.com> wrote:
> On Thu, Apr 4, 2013 at 12:53 PM, Bernhard Reutner-Fischer
> <rep.dot.nop@gmail.com> wrote:
>>
>> 2013-03-24  Bernhard Reutner-Fischer  <aldot@gcc.gnu.org>
>>
>>         * configure.ac (libgcc_cv_dfp): Extend check to probe fenv.h
>>         availability.
>>         * configure: Regenerate
>
> This is OK.

Applied just now as r204562.
thanks,

Patch

diff --git a/libgcc/configure b/libgcc/configure
index 1425df6..90936e8 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -4048,7 +4048,20 @@  if test "${libgcc_cv_dfp+set}" = set; then :
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
+#include <fenv.h>
+
+int
+main ()
+{
+
 _Decimal32 x;
+int fe_except =
+  FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW|FE_UNDERFLOW|FE_INEXACT;
+
+  ;
+  return 0;
+}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
   libgcc_cv_dfp=yes
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 8b7aba5..e3d713d 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -172,7 +172,14 @@  AC_SUBST(long_double_type_size)
 
 # Check for decimal float support.
 AC_CACHE_CHECK([whether decimal floating point is supported], [libgcc_cv_dfp],
-	       [AC_COMPILE_IFELSE([_Decimal32 x;], [libgcc_cv_dfp=yes],
+	       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <fenv.h>
+]], [[
+_Decimal32 x;
+int fe_except =
+  FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW|FE_UNDERFLOW|FE_INEXACT;
+]])],
+				  [libgcc_cv_dfp=yes],
 				  [libgcc_cv_dfp=no])])
 decimal_float=$libgcc_cv_dfp
 AC_SUBST(decimal_float)