[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r11745 - in /fsf/trunk/libc: ./ include/ math/ posix/ stdio-common/ sysdeps/i386/fpu/ sysdeps/i386/i686/multiarch/ sysdeps/i...
- To: commits@xxxxxxxxxx
- Subject: [commits] r11745 - in /fsf/trunk/libc: ./ include/ math/ posix/ stdio-common/ sysdeps/i386/fpu/ sysdeps/i386/i686/multiarch/ sysdeps/i...
- From: eglibc@xxxxxxxxxx
- Date: Tue, 12 Oct 2010 07:03:12 -0000
Author: eglibc
Date: Tue Oct 12 00:03:11 2010
New Revision: 11745
Log:
Import glibc-mainline for 2010-10-12
Added:
fsf/trunk/libc/posix/bug-regex31.c
fsf/trunk/libc/posix/bug-regex31.input
fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/include/fenv.h
fsf/trunk/libc/math/feupdateenv.c
fsf/trunk/libc/math/ftestexcept.c
fsf/trunk/libc/math/libm-test.inc
fsf/trunk/libc/posix/Makefile
fsf/trunk/libc/posix/regcomp.c
fsf/trunk/libc/stdio-common/psiginfo.c
fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/i386/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/i386/i686/multiarch/s_fmaf.c
fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/ia64/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/powerpc/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/s390/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/s390/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/sparc/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/sparc/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c
fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c
fsf/trunk/libc/sysdeps/x86_64/fpu/ftestexcept.c
fsf/trunk/libc/sysdeps/x86_64/multiarch/s_fmaf.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Tue Oct 12 00:03:11 2010
@@ -1,3 +1,59 @@
+2010-10-11 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ * posix/bug-regex31.c: Rewrite to run multiple tests from stdin.
+ * posix/bug-regex31.input: New file.
+
+ [BZ #12078]
+ * posix/regcomp.c (parse_branch): Free memory when allocation failed.
+ (parse_sub_exp): Fix last change, use postorder.
+
+ * posix/bug-regex31.c: New file.
+ * posix/Makefile: Add rules to build and run bug-regex31.
+
+ * posix/regcomp.c (parse_bracket_exp): Add missing re_free calls.
+
+ [BZ #12078]
+ * posix/regcomp.c (parse_sub_exp): Free tree data when it is not used.
+
+ [BZ #12108]
+ * stdio-common/psiginfo.c (psiginfo): Don't expext SIGRTMIN..SIGRTMAX
+ to have entries in sys_siglist.
+
+ [BZ #12093]
+ * sysdeps/unix/sysv/linux/check_pf.c (__check_pf): ->ifa_addr might
+ be NULL.
+
+2010-10-07 Jakub Jelinek <jakub@xxxxxxxxxx>
+
+ [BZ #3268]
+ * math/libm-test.inc (fma_test): Add 2 fmaf tests.
+ * sysdeps/ieee754/dbl-64/s_fmaf.c: New file.
+ * sysdeps/i386/i686/multiarch/s_fmaf.c: Include
+ sysdeps/ieee754/dbl-64/s_fmaf.c instead of math/s_fmaf.c.
+ * sysdeps/x86_64/multiarch/s_fmaf.c: Likewise.
+ * include/fenv.h (feupdateenv, fetestexcept): Add libm_hidden_proto.
+ * math/feupdateenv.c (feupdateenv): Add libm_hidden_ver.
+ * sysdeps/i386/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/powerpc/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/x86_64/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/sparc/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * sysdeps/ia64/fpu/feupdateenv.c (feupdateenv): Add libm_hidden_def.
+ * sysdeps/s390/fpu/feupdateenv.c (feupdateenv): Likewise.
+ * math/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/ia64/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/i386/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/s390/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/powerpc/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/x86_64/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/sparc/fpu/ftestexcept.c (fetestexcept): Likewise.
+ * sysdeps/sh/sh4/fpu/ftestexcept.c (fetestexcept): Likewise.
+
+2010-10-11 Ulrich Drepper <drepper@xxxxxxxxx>
+
+ [BZ #12107]
+ * stdio-common/psiginfo.c (psiginfo): Terminate all strings with
+ newline.
+
2010-10-06 Ulrich Drepper <drepper@xxxxxxxxx>
* string/bug-strstr1.c: New file.
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Tue Oct 12 00:03:11 2010
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes. 2010-10-3
+GNU C Library NEWS -- history of user-visible changes. 2010-10-11
Copyright (C) 1992-2009, 2010 Free Software Foundation, Inc.
See the end for copying conditions.
@@ -9,8 +9,8 @@
* The following bugs are resolved with this release:
- 7066, 10851, 11611, 11640, 11701, 11840, 11856, 11883, 11903, 11904,
- 11968, 11979, 12005, 12037, 12067, 12077
+ 3268, 7066, 10851, 11611, 11640, 11701, 11840, 11856, 11883, 11903, 11904,
+ 11968, 11979, 12005, 12037, 12067, 12077, 12078, 12092, 12093, 12107, 12108
* New Linux interfaces: prlimit, prlimit64, fanotify_init, fanotify_mark
Modified: fsf/trunk/libc/include/fenv.h
==============================================================================
--- fsf/trunk/libc/include/fenv.h (original)
+++ fsf/trunk/libc/include/fenv.h Tue Oct 12 00:03:11 2010
@@ -17,5 +17,7 @@
libm_hidden_proto (fesetenv)
libm_hidden_proto (fesetround)
libm_hidden_proto (feholdexcept)
+libm_hidden_proto (feupdateenv)
+libm_hidden_proto (fetestexcept)
#endif
Modified: fsf/trunk/libc/math/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/math/feupdateenv.c (original)
+++ fsf/trunk/libc/math/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -31,6 +31,7 @@
strong_alias (__feupdateenv, __old_feupdateenv)
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
stub_warning (feupdateenv)
Modified: fsf/trunk/libc/math/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/math/ftestexcept.c (original)
+++ fsf/trunk/libc/math/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -25,5 +25,6 @@
{
return 0;
}
+libm_hidden_def (fetestexcept)
stub_warning (fetestexcept)
#include <stub-tag.h>
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Tue Oct 12 00:03:11 2010
@@ -2789,6 +2789,10 @@
TEST_fff_f (fma, minus_infty, minus_infty, minus_infty, nan_value, INVALID_EXCEPTION);
TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L);
+#ifdef TEST_FLOAT
+ TEST_fff_f (fma, 0x1.7ff8p+13, 0x1.000002p+0, 0x1.ffffp-24, 0x1.7ff802p+13);
+ TEST_fff_f (fma, 0x1.fffp+0, 0x1.00001p+0, -0x1.fffp+0, 0x1.fffp-20);
+#endif
END (fma);
}
Modified: fsf/trunk/libc/posix/Makefile
==============================================================================
--- fsf/trunk/libc/posix/Makefile (original)
+++ fsf/trunk/libc/posix/Makefile Tue Oct 12 00:03:11 2010
@@ -82,7 +82,7 @@
bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
- bug-regex29 bug-regex30 \
+ bug-regex29 bug-regex30 bug-regex31 \
tst-nice tst-nanosleep tst-regex2 \
transbug tst-rxspencer tst-pcre tst-boost \
bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
@@ -111,6 +111,7 @@
annexc annexc.out wordexp-tst.out bug-regex2-mem \
bug-regex2.mtrace bug-regex14-mem bug-regex14.mtrace \
bug-regex21-mem bug-regex21.mtrace \
+ bug-regex31-mem bug-regex31.mtrace \
tst-rxspencer-mem tst-rxspencer.mtrace tst-getconf.out \
tst-pcre-mem tst-pcre.mtrace tst-boost-mem tst-boost.mtrace \
bug-ga2.mtrace bug-ga2-mem bug-glob2.mtrace bug-glob2-mem \
@@ -232,7 +233,7 @@
tests: $(objpfx)annexc.out
ifeq (no,$(cross-compiling))
tests: $(objpfx)bug-regex2-mem $(objpfx)bug-regex14-mem \
- $(objpfx)bug-regex21-mem $(objpfx)tst-rxspencer-mem \
+ $(objpfx)bug-regex21-mem $(objpfx)bug-regex31-mem $(objpfx)tst-rxspencer-mem\
$(objpfx)tst-pcre-mem $(objpfx)tst-boost-mem $(objpfx)tst-getconf.out \
$(objpfx)bug-glob2-mem $(objpfx)tst-vfork3-mem
xtests: $(objpfx)bug-ga2-mem
@@ -260,6 +261,11 @@
$(objpfx)bug-regex21-mem: $(objpfx)bug-regex21.out
$(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@
+
+bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace
+
+$(objpfx)bug-regex31-mem: $(objpfx)bug-regex31.out
+ $(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@
tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace
Added: fsf/trunk/libc/posix/bug-regex31.c
==============================================================================
--- fsf/trunk/libc/posix/bug-regex31.c (added)
+++ fsf/trunk/libc/posix/bug-regex31.c Tue Oct 12 00:03:11 2010
@@ -1,0 +1,36 @@
+#include <mcheck.h>
+#include <regex.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+int
+main (void)
+{
+ mtrace ();
+
+ int res = 0;
+ char *buf = NULL;
+ size_t len = 0;
+ while (! feof (stdin))
+ {
+ ssize_t n = getline (&buf, &len, stdin);
+ if (n <= 0)
+ break;
+ if (buf[n - 1] == '\n')
+ buf[n - 1] = '\0';
+
+ regex_t regex;
+ int rc = regcomp (®ex, buf, REG_EXTENDED);
+ if (rc != 0)
+ printf ("%s: Error %d (expected)\n", buf, rc);
+ else
+ {
+ printf ("%s: succeeded !\n", buf);
+ res = 1;
+ }
+ }
+
+ free (buf);
+
+ return 0;
+}
Added: fsf/trunk/libc/posix/bug-regex31.input
==============================================================================
--- fsf/trunk/libc/posix/bug-regex31.input (added)
+++ fsf/trunk/libc/posix/bug-regex31.input Tue Oct 12 00:03:11 2010
@@ -1,0 +1,3 @@
+([0]
+([0]a
+([0]([0])
Modified: fsf/trunk/libc/posix/regcomp.c
==============================================================================
--- fsf/trunk/libc/posix/regcomp.c (original)
+++ fsf/trunk/libc/posix/regcomp.c Tue Oct 12 00:03:11 2010
@@ -2164,12 +2164,15 @@
}
if (tree != NULL && exp != NULL)
{
- tree = create_tree (dfa, tree, exp, CONCAT);
- if (tree == NULL)
+ bin_tree_t *newtree = create_tree (dfa, tree, exp, CONCAT);
+ if (newtree == NULL)
{
+ postorder (exp, free_tree, NULL);
+ postorder (tree, free_tree, NULL);
*err = REG_ESPACE;
return NULL;
}
+ tree = newtree;
}
else if (tree == NULL)
tree = exp;
@@ -2418,7 +2421,11 @@
{
tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
- *err = REG_EPAREN;
+ {
+ if (tree != NULL)
+ postorder (tree, free_tree, NULL);
+ *err = REG_EPAREN;
+ }
if (BE (*err != REG_NOERROR, 0))
return NULL;
}
@@ -3028,6 +3035,10 @@
if (BE (sbcset == NULL, 0))
#endif /* RE_ENABLE_I18N */
{
+ re_free (sbcset);
+#ifdef RE_ENABLE_I18N
+ re_free (mbcset);
+#endif
*err = REG_ESPACE;
return NULL;
}
Modified: fsf/trunk/libc/stdio-common/psiginfo.c
==============================================================================
--- fsf/trunk/libc/stdio-common/psiginfo.c (original)
+++ fsf/trunk/libc/stdio-common/psiginfo.c Tue Oct 12 00:03:11 2010
@@ -1,4 +1,4 @@
-/* Copyright (C) 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -85,9 +85,28 @@
const char *desc;
if (pinfo->si_signo >= 0 && pinfo->si_signo < NSIG
- && (desc = INTUSE(_sys_siglist)[pinfo->si_signo]) != NULL)
+ && ((desc = INTUSE(_sys_siglist)[pinfo->si_signo]) != NULL
+ || (pinfo->si_signo >= SIGRTMIN && pinfo->si_signo < SIGRTMAX)))
{
- fprintf (fp, "%s (", _(desc));
+ if (desc == NULL)
+ {
+ if (pinfo->si_signo - SIGRTMIN < SIGRTMAX - pinfo->si_signo)
+ {
+ if (pinfo->si_signo == SIGRTMIN)
+ fprintf (fp, "SIGRTMIN (");
+ else
+ fprintf (fp, "SIGRTMIN+%d (", pinfo->si_signo - SIGRTMIN);
+ }
+ else
+ {
+ if (pinfo->si_signo == SIGRTMAX)
+ fprintf (fp, "SIGRTMAX (");
+ else
+ fprintf (fp, "SIGRTMAX-%d (", SIGRTMAX - pinfo->si_signo);
+ }
+ }
+ else
+ fprintf (fp, "%s (", _(desc));
const char *base = NULL;
const uint8_t *offarr = NULL;
@@ -165,14 +184,15 @@
if (pinfo->si_signo == SIGILL || pinfo->si_signo == SIGFPE
|| pinfo->si_signo == SIGSEGV || pinfo->si_signo == SIGBUS)
- fprintf (fp, "[%p])", pinfo->si_addr);
+ fprintf (fp, "[%p])\n", pinfo->si_addr);
else if (pinfo->si_signo == SIGCHLD)
- fprintf (fp, "%ld %d %ld)", (long int) pinfo->si_pid, pinfo->si_status,
+ fprintf (fp, "%ld %d %ld)\n",
+ (long int) pinfo->si_pid, pinfo->si_status,
(long int) pinfo->si_uid);
else if (pinfo->si_signo == SIGPOLL)
- fprintf (fp, "%ld)", (long int) pinfo->si_band);
- else
- fprintf (fp, "%ld %ld)",
+ fprintf (fp, "%ld)\n", (long int) pinfo->si_band);
+ else
+ fprintf (fp, "%ld %ld)\n",
(long int) pinfo->si_pid, (long int) pinfo->si_uid);
}
else
Modified: fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -57,4 +57,5 @@
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
Modified: fsf/trunk/libc/sysdeps/i386/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/i386/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2003, 2004, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -38,3 +38,4 @@
return (temp | xtemp) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
Modified: fsf/trunk/libc/sysdeps/i386/i686/multiarch/s_fmaf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/i686/multiarch/s_fmaf.c (original)
+++ fsf/trunk/libc/sysdeps/i386/i686/multiarch/s_fmaf.c Tue Oct 12 00:03:11 2010
@@ -33,4 +33,4 @@
# define __fmaf __fmaf_ia32
#endif
-#include <math/s_fmaf.c>
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>
Modified: fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/ia64/fpu/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 2000, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2007, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@xxxxxxx>, 1999.
@@ -38,3 +38,4 @@
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
Modified: fsf/trunk/libc/sysdeps/ia64/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ia64/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/ia64/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Christian Boissat <Christian.Boissat@xxxxxxx>, 1999.
@@ -30,3 +30,4 @@
return (fpsr >> 13) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
Added: fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c (added)
+++ fsf/trunk/libc/sysdeps/ieee754/dbl-64/s_fmaf.c Tue Oct 12 00:03:11 2010
@@ -1,0 +1,50 @@
+/* Compute x * y + z as ternary operation.
+ Copyright (C) 2010 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Jakub Jelinek <jakub@xxxxxxxxxx>, 2010.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <math.h>
+#include <fenv.h>
+#include <ieee754.h>
+
+/* This implementation relies on double being more than twice as
+ precise as float and uses rounding to odd in order to avoid problems
+ with double rounding.
+ See a paper by Boldo and Melquiond:
+ http://www.lri.fr/~melquion/doc/08-tc.pdf */
+
+float
+__fmaf (float x, float y, float z)
+{
+ fenv_t env;
+ /* Multiplication is always exact. */
+ double temp = (double) x * (double) y;
+ union ieee754_double u;
+ feholdexcept (&env);
+ fesetround (FE_TOWARDZERO);
+ /* Perform addition with round to odd. */
+ u.d = temp + (double) z;
+ if ((u.ieee.mantissa1 & 1) == 0 && u.ieee.exponent != 0xff)
+ u.ieee.mantissa1 |= fetestexcept (FE_INEXACT) != 0;
+ feupdateenv (&env);
+ /* And finally truncation with round to nearest. */
+ return (float) u.d;
+}
+#ifndef __fmaf
+weak_alias (__fmaf, fmaf)
+#endif
Modified: fsf/trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/powerpc/fpu/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000, 2001, 2007, 2008
+ Copyright (C) 1997, 1999, 2000, 2001, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -66,4 +66,5 @@
compat_symbol (libm, BP_SYM (__old_feupdateenv), BP_SYM (feupdateenv), GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, BP_SYM (__feupdateenv), BP_SYM (feupdateenv), GLIBC_2_2);
Modified: fsf/trunk/libc/sysdeps/powerpc/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/powerpc/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,3 +31,4 @@
just: */
return u.l[1] & excepts;
}
+libm_hidden_def (fetestexcept)
Modified: fsf/trunk/libc/sysdeps/s390/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/s390/fpu/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@xxxxxxxxxx).
@@ -38,3 +38,4 @@
/* Success. */
return 0;
}
+libm_hidden_def (feupdateenv)
Modified: fsf/trunk/libc/sysdeps/s390/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/s390/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/s390/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Denis Joseph Barrow (djbarrow@xxxxxxxxxx).
@@ -31,3 +31,4 @@
temp = (temp >> FPC_DXC_SHIFT) | (temp >> FPC_FLAGS_SHIFT);
return temp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
Modified: fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/sh/sh4/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -30,3 +30,4 @@
return temp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
Modified: fsf/trunk/libc/sysdeps/sparc/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/sparc/fpu/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2000, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,4 +46,5 @@
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
Modified: fsf/trunk/libc/sysdeps/sparc/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/sparc/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/sparc/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -28,3 +28,4 @@
return tmp & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Determine protocol families for which interfaces exist. Linux version.
- Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2007, 2008, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -304,10 +304,13 @@
struct ifaddrs *runp;
for (runp = ifa; runp != NULL; runp = runp->ifa_next)
- if (runp->ifa_addr->sa_family == PF_INET)
- *seen_ipv4 = true;
- else if (runp->ifa_addr->sa_family == PF_INET6)
- *seen_ipv6 = true;
+ if (runp->ifa_addr != NULL)
+ {
+ if (runp->ifa_addr->sa_family == PF_INET)
+ *seen_ipv4 = true;
+ else if (runp->ifa_addr->sa_family == PF_INET6)
+ *seen_ipv6 = true;
+ }
(void) freeifaddrs (ifa);
#endif
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/feupdateenv.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01,07 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
@@ -48,4 +48,5 @@
compat_symbol (libm, __old_feupdateenv, feupdateenv, GLIBC_2_1);
#endif
+libm_hidden_ver (__feupdateenv, feupdateenv)
versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
Modified: fsf/trunk/libc/sysdeps/x86_64/fpu/ftestexcept.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/ftestexcept.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/ftestexcept.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* Test exception in current environment.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -31,3 +31,4 @@
return (temp | mxscr) & excepts & FE_ALL_EXCEPT;
}
+libm_hidden_def (fetestexcept)
Modified: fsf/trunk/libc/sysdeps/x86_64/multiarch/s_fmaf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/multiarch/s_fmaf.c (original)
+++ fsf/trunk/libc/sysdeps/x86_64/multiarch/s_fmaf.c Tue Oct 12 00:03:11 2010
@@ -1,5 +1,5 @@
/* FMA version of fmaf.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -39,4 +39,4 @@
# define __fmaf __fmaf_sse2
#endif
-#include <math/s_fmaf.c>
+#include <sysdeps/ieee754/dbl-64/s_fmaf.c>