[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8872 - in /trunk/libc: ./ locale/ math/ nptl/ nptl/sysdeps/unix/sysv/linux/bits/ nptl/sysdeps/unix/sysv/linux/x86_64/ nptl_...



Author: joseph
Date: Tue Aug 25 08:16:23 2009
New Revision: 8872

Log:
Merge changes between r8789 and r8871 from /fsf/trunk.

Added:
    trunk/libc/posix/bug-regex29.c
      - copied unchanged from r8871, fsf/trunk/libc/posix/bug-regex29.c
    trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/
      - copied from r8871, fsf/trunk/libc/sysdeps/ieee754/dbl-64/wordsize-64/
    trunk/libc/sysdeps/unix/syscall-template.S
      - copied unchanged from r8871, fsf/trunk/libc/sysdeps/unix/syscall-template.S
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S
      - copied unchanged from r8871, fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S
    trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
      - copied unchanged from r8871, fsf/trunk/libc/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
Removed:
    trunk/libc/sysdeps/powerpc/powerpc32/____longjmp_chk.S
    trunk/libc/sysdeps/powerpc/powerpc64/____longjmp_chk.S
Modified:
    trunk/libc/ChangeLog
    trunk/libc/locale/locale.h
    trunk/libc/math/math.h
    trunk/libc/math/math_private.h
    trunk/libc/math/s_fdim.c
    trunk/libc/math/s_fdimf.c
    trunk/libc/math/s_fdiml.c
    trunk/libc/nptl/ChangeLog
    trunk/libc/nptl/pthread_create.c
    trunk/libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
    trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
    trunk/libc/nptl_db/ChangeLog
    trunk/libc/nptl_db/td_ta_map_lwp2thr.c
    trunk/libc/posix/Makefile
    trunk/libc/posix/regcomp.c
    trunk/libc/posix/unistd.h
    trunk/libc/scripts/gen-as-const.awk
    trunk/libc/stdio-common/printf_fp.c
    trunk/libc/stdio-common/printf_fphex.c
    trunk/libc/stdio-common/tstdiomisc.c
    trunk/libc/stdlib/longlong.h
    trunk/libc/sysdeps/generic/elf/backtracesyms.c
    trunk/libc/sysdeps/generic/elf/backtracesymsfd.c
    trunk/libc/sysdeps/i386/fpu/bits/mathinline.h
    trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
    trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
    trunk/libc/sysdeps/unix/Makefile
    trunk/libc/sysdeps/unix/make-syscalls.sh
    trunk/libc/sysdeps/x86_64/fpu/bits/mathinline.h
    trunk/libc/sysdeps/x86_64/fpu/math_private.h
    trunk/libc/test-skeleton.c

Modified: trunk/libc/ChangeLog
==============================================================================
--- trunk/libc/ChangeLog (original)
+++ trunk/libc/ChangeLog Tue Aug 25 08:16:23 2009
@@ -1,3 +1,89 @@
+2009-08-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* math/math_private.h (ieee_double_shape_type): Add uint64_t word to
+	union.
+	(EXTRACT_WORDS64, INSERT_WORDS64): Define.
+	* sysdeps/x86_64/fpu/math_private.h (EXTRACT_WORDS64, INSERT_WORDS64):
+	Redefine.
+	* sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c: New file.
+
+	* sysdeps/x86_64/fpu/math_private.h: Add specialized GET_FLOAT_WORD
+	and SET_FLOAT_WORD definitions.
+
+2009-08-24  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* sysdeps/unix/syscall-template.S: New file.
+	* sysdeps/unix/make-syscalls.sh: Generate rules to use it.
+	* sysdeps/unix/Makefile (omit-deps): Do not omit syscall stubs' deps.
+	(compile-syscall): Pass mkdep and -g options as normal.
+	(s-proto.d, s-proto-cancel.d): Don't "-include" these.
+	(common-generated): Don't add them here.
+
+2009-08-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* math/s_fdim.c: In case of overflows set errno.
+	* math/s_fdimf.c: Likewise.
+	* math/s_fdiml.c: Likewise.
+
+	* math/math.h: Define math_errhandling of __FAST_MATH__ is not defined.
+	* sysdeps/i386/fpu/bits/mathinline.h: Undefine math_errhandling if we
+	are using the inline optimizations.
+
+	* sysdeps/x86_64/fpu/bits/mathinline.h (__signbit): Optimize.
+	(__signbitf): Likewise.
+
+2009-08-23  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* posix/regcomp.c (parse_dup_op): Verify the expression is correctly
+	terminated.
+	* posix/Makefile (tests): Add bug-regex29.
+	* posix/bug-regex29.c: New file.
+
+	* posix/unistd.h: Define _POSIX_VERSION and _POSIX2_* correctly if
+	older POSIX versions are selected.
+
+	* stdio-common/printf_fp.c: ISO C expects to print the sign of NaN
+	as well.
+	* stdio-common/printf_fphex.c: Likewise.
+	* stdio-common/tstdiomisc.c: Add more tests.
+
+	* locale/locale.h: Include xlocale.h and the thread-local locale
+	declarations for XPG7, not XPG6.
+
+2009-08-21  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/powerpc/powerpc32/____longjmp_chk.S: Removed.
+	* sysdeps/powerpc/powerpc64/____longjmp_chk.S: Removed.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc32/____longjmp_chk.S: New file.
+	* sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S: New file.
+	* sysdeps/powerpc/powerpc32/__longjmp-common.S: Move CHECK_SP earlier.
+	* sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S: Likewise.
+
+2009-08-20  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* sysdeps/generic/elf/backtracesyms.c (__backtrace_symbols):
+	Use l_addr instead of l_map_start (dli_fbase).
+	Print "FILE([+-]OFFSET) [ADDRESS]" with the file-relative
+	address when there is no proximate symbol.
+	* sysdeps/generic/elf/backtracesymsfd.c (__backtrace_symbols_fd):
+	Likewise.
+
+2009-08-16  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* scripts/gen-as-const.awk: Fix test for 64-bit platform.
+
+2009-08-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* test-skeleton.c (signal_handler): Renamed from timeout_handler.
+	Also handle SIGINT.  In that case only do the cleanup and then
+	re-raise the signal.
+	(main): Install handler for SIGINT.
+
+2009-08-10  SUGIOKA Toshinobu  <sugioka@xxxxxxxxxxxx>
+
+	* stdlib/longlong.h [__sh__] (udiv_qrnnd, sub_ddmmss): Add "t" to
+	clobber list.
+
 2009-08-01  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
 
 	* elf/Makefile (distribute): Add tst-audit6.c tst-auditmod6a.c
@@ -46,7 +132,7 @@
 
 	* sysdeps/x86_64/strcmp.S: Add support to compile with
 	USE_SSSE3.  In this case palignr is used.
-	* sysdeps/x86_64/multiarch/strcmp.S (strcmp): If SSE4.3 is not
+	* sysdeps/x86_64/multiarch/strcmp.S (strcmp): If SSE4.2 is not
 	available but SSSE3 is, pick __str{,n}cmp_ssse3.
 	* sysdeps/x86_64/multiarch/Makefile [subdir=string] (sysdep_routines):
 	Add strcmp-ssse3 and strncmp-ssse3.
@@ -1791,7 +1877,7 @@
 	* sysdeps/x86_64/mp_clz_tab.c: New file.
 
 2009-03-17  Ryan S. Arnold  <rsa@xxxxxxxxxx>
-            Ulrich Drepper  <drepper@xxxxxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/fallocate.c: Handle old kernel headers.
 	* sysdeps/unix/sysv/linux/fallocate64.c: Likewise.

Modified: trunk/libc/locale/locale.h
==============================================================================
--- trunk/libc/locale/locale.h (original)
+++ trunk/libc/locale/locale.h Tue Aug 25 08:16:23 2009
@@ -130,7 +130,7 @@
 __END_NAMESPACE_STD
 
 
-#ifdef	__USE_XOPEN2K
+#ifdef	__USE_XOPEN2K8
 /* The concept of one static locale per category is not very well
    thought out.  Many applications will need to process its data using
    information from several different locales.  Another application is

Modified: trunk/libc/math/math.h
==============================================================================
--- trunk/libc/math/math.h (original)
+++ trunk/libc/math/math.h Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Declarations for math functions.
-   Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006
+   Copyright (C) 1991-1993, 1995-1999, 2001, 2002, 2004, 2006, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -101,7 +101,7 @@
      && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT)
 #  ifdef __LDBL_COMPAT
 
-#   ifdef __USE_ISOC99 
+#   ifdef __USE_ISOC99
 extern float __nldbl_nexttowardf (float __x, long double __y)
 				  __THROW __attribute__ ((__const__));
 #    ifdef __REDIRECT_NTH
@@ -276,6 +276,13 @@
 /* Bitmasks for the math_errhandling macro.  */
 # define MATH_ERRNO	1	/* errno set by math functions.  */
 # define MATH_ERREXCEPT	2	/* Exceptions raised by math functions.  */
+
+/* By default all functions support both errno and exception handling.
+   In gcc's fast math mode and if inline functions are defined this
+   might not be true.  */
+# ifndef __FAST_MATH__
+#  define math_errhandling	(MATH_ERRNO | MATH_ERREXCEPT)
+# endif
 
 #endif /* Use ISO C99.  */
 

Modified: trunk/libc/math/math_private.h
==============================================================================
--- trunk/libc/math/math_private.h (original)
+++ trunk/libc/math/math_private.h Tue Aug 25 08:16:23 2009
@@ -17,6 +17,7 @@
 #define _MATH_PRIVATE_H_
 
 #include <endian.h>
+#include <stdint.h>
 #include <sys/types.h>
 
 /* The original fdlibm code used statements like:
@@ -43,6 +44,7 @@
     u_int32_t msw;
     u_int32_t lsw;
   } parts;
+  uint64_t word;
 } ieee_double_shape_type;
 
 #endif
@@ -57,6 +59,7 @@
     u_int32_t lsw;
     u_int32_t msw;
   } parts;
+  uint64_t word;
 } ieee_double_shape_type;
 
 #endif
@@ -89,6 +92,14 @@
   (i) = gl_u.parts.lsw;						\
 } while (0)
 
+/* Get all in one, efficient on 64-bit machines.  */
+#define EXTRACT_WORDS64(i,d)					\
+do {								\
+  ieee_double_shape_type gh_u;					\
+  gh_u.value = (d);						\
+  (i) = gh_u.word;						\
+} while (0)
+
 /* Set a double from two 32 bit ints.  */
 
 #define INSERT_WORDS(d,ix0,ix1)					\
@@ -96,6 +107,14 @@
   ieee_double_shape_type iw_u;					\
   iw_u.parts.msw = (ix0);					\
   iw_u.parts.lsw = (ix1);					\
+  (d) = iw_u.value;						\
+} while (0)
+
+/* Get all in one, efficient on 64-bit machines.  */
+#define INSERT_WORDS64(i,d)					\
+do {								\
+  ieee_double_shape_type iw_u;					\
+  iw_u.word = (i);						\
   (d) = iw_u.value;						\
 } while (0)
 

Modified: trunk/libc/math/s_fdim.c
==============================================================================
--- trunk/libc/math/s_fdim.c (original)
+++ trunk/libc/math/s_fdim.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <math.h>
 
 double
@@ -31,7 +32,14 @@
     /* Raise invalid flag.  */
     return x - y;
 
-  return x <= y ? 0 : x - y;
+  if (x <= y)
+    return 0.0;
+
+  double r = x - y;
+  if (fpclassify (r) == FP_INFINITE)
+    __set_errno (ERANGE);
+
+  return r;
 }
 weak_alias (__fdim, fdim)
 #ifdef NO_LONG_DOUBLE

Modified: trunk/libc/math/s_fdimf.c
==============================================================================
--- trunk/libc/math/s_fdimf.c (original)
+++ trunk/libc/math/s_fdimf.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -18,6 +18,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <math.h>
 
 float
@@ -31,6 +32,13 @@
     /* Raise invalid flag.  */
     return x - y;
 
-  return x <= y ? 0 : x - y;
+  if (x <= y)
+    return 0.0f;
+
+  float r = x - y;
+  if (fpclassify (r) == FP_INFINITE)
+    __set_errno (ERANGE);
+
+  return r;
 }
 weak_alias (__fdimf, fdimf)

Modified: trunk/libc/math/s_fdiml.c
==============================================================================
--- trunk/libc/math/s_fdiml.c (original)
+++ trunk/libc/math/s_fdiml.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Return positive difference between arguments.
-   Copyright (C) 1997, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2004, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -18,19 +18,27 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <math.h>
 
 long double
 __fdiml (long double x, long double y)
 {
-  int clsx = fpclassify (x);
-  int clsy = fpclassify (y);
+  int clsx = fpclassifyl (x);
+  int clsy = fpclassifyl (y);
 
   if (clsx == FP_NAN || clsy == FP_NAN
       || (y < 0 && clsx == FP_INFINITE && clsy == FP_INFINITE))
     /* Raise invalid flag.  */
     return x - y;
 
-  return x <= y ? 0 : x - y;
+  if (x <= y)
+    return 0.0f;
+
+  long double r = x - y;
+  if (fpclassify (r) == FP_INFINITE)
+    __set_errno (ERANGE);
+
+  return r;
 }
 weak_alias (__fdiml, fdiml)

Modified: trunk/libc/nptl/ChangeLog
==============================================================================
--- trunk/libc/nptl/ChangeLog (original)
+++ trunk/libc/nptl/ChangeLog Tue Aug 25 08:16:23 2009
@@ -1,3 +1,30 @@
+2009-08-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* pthread_create.c (start_thread): Hint to the kernel that memory for
+	the stack can be reused.  We do not mark all the memory.  The part
+	still in use and some reserve are kept.
+
+2009-08-23  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/bits/posix_opt.h: Clean up namespace.
+
+2009-08-11  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Add CFI
+	directives.
+
+2009-08-10  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Add CFI
+	directives.
+	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
+
+2009-08-10  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
+	(__pthread_cond_signal): Don't clobber register used for syscall
+	number.
+
 2009-08-08  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait):
@@ -1826,9 +1853,9 @@
 	* sysdeps/unix/sysv/linux/sh/bits/pthreadtypes.h: Include endian.h.
 	Split __flags into __flags, __shared, __pad1 and __pad2.
 	* sysdeps/unix/sysv/linux/sh/libc-lowlevellock.S: Use private
-        futexes if they are available.
+	futexes if they are available.
 	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Adjust so that change
-        in libc-lowlevellock.S allow using private futexes.
+	in libc-lowlevellock.S allow using private futexes.
 	* sysdeps/unix/sysv/linux/sh/lowlevellock.h: Define
 	FUTEX_PRIVATE_FLAG.  Add additional parameter to lll_futex_wait,
 	lll_futex_timed_wait and lll_futex_wake.  Change lll_futex_wait
@@ -1836,12 +1863,12 @@
 	lll_private_futex_timed_wait and lll_private_futex_wake.
 	(lll_robust_mutex_unlock): Fix typo.
 	* sysdeps/unix/sysv/linux/sh/pthread_barrier_wait.S: Use private
-        field in futex command setup.
+	field in futex command setup.
 	* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Use
 	COND_NWAITERS_SHIFT instead of COND_CLOCK_BITS.
 	* sysdeps/unix/sysv/linux/sh/pthread_cond_wait.S: Likewise.
 	* sysdeps/unix/sysv/linux/sh/pthread_once.S: Use private futexes
-        if they are available.  Remove clear_once_control.
+	if they are available.  Remove clear_once_control.
 	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Use private
 	futexes if they are available.
 	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
@@ -1852,7 +1879,7 @@
 	Wake only when there are waiters.
 	* sysdeps/unix/sysv/linux/sh/sem_wait.S: Add private futex
 	support.  Indicate that there are waiters.  Remove unnecessary
-        extra cancellation test.
+	extra cancellation test.
 	* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.  Removed
 	left-over duplication of __sem_wait_cleanup.
 
@@ -2566,14 +2593,14 @@
 	* tst-cancel25.c: New file.
 
 2006-09-05  Jakub Jelinek  <jakub@xxxxxxxxxx>
-            Ulrich Drepper  <drepper@xxxxxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/pthread/gai_misc.h (GAI_MISC_NOTIFY): Don't decrement
 	counterp if it is already zero.
 	* sysdeps/pthread/aio_misc.h (AIO_MISC_NOTIFY): Likewise..
 
 2006-03-04  Jakub Jelinek  <jakub@xxxxxxxxxx>
-            Roland McGrath  <roland@xxxxxxxxxx>
+	    Roland McGrath  <roland@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/i386/lowlevellock.h
 	(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
@@ -2587,7 +2614,7 @@
 	* sysdeps/unix/sysv/linux/i386/i486/lowlevelrobustlock.S: Likewise.
 
 2006-03-03  Jakub Jelinek  <jakub@xxxxxxxxxx>
-            Roland McGrath  <roland@xxxxxxxxxx>
+	    Roland McGrath  <roland@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
 	(LLL_STUB_UNWIND_INFO_START, LLL_STUB_UNWIND_INFO_END,
@@ -3160,7 +3187,7 @@
 	* sysdeps/pthread/pthread.h: Adjust mutex initializers.
 
 	* sysdeps/unix/sysv/linux/i386/not-cancel.h: Define openat_not_cancel,
-        openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
+	openat_not_cancel_3, openat64_not_cancel, and openat64_not_cancel_3.
 
 2006-02-08  Jakub Jelinek  <jakub@xxxxxxxxxx>
 
@@ -3582,7 +3609,7 @@
 	* Makefile ($(test-modules)): Remove static pattern rule.
 
 2005-10-14  Jakub Jelinek  <jakub@xxxxxxxxxx>
-            Ulrich Drepper  <drepper@xxxxxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Fix stack
 	alignment in callback function.
@@ -3600,7 +3627,7 @@
 	atomic_compare_and_exchange_bool_acq.
 
 2005-10-01  Ulrich Drepper  <drepper@xxxxxxxxxx>
-            Jakub Jelinek  <jakub@xxxxxxxxxx>
+	    Jakub Jelinek  <jakub@xxxxxxxxxx>
 
 	* descr.h: Define SETXID_BIT and SETXID_BITMASK.  Adjust
 	CANCEL_RESTMASK.

Modified: trunk/libc/nptl/pthread_create.c
==============================================================================
--- trunk/libc/nptl/pthread_create.c (original)
+++ trunk/libc/nptl/pthread_create.c Tue Aug 25 08:16:23 2009
@@ -382,6 +382,19 @@
     }
 #endif
 
+  /* Mark the memory of the stack as usable to the kernel.  We free
+     everything except for the space used for the TCB itself.  */
+  size_t pagesize_m1 = __getpagesize () - 1;
+#ifdef _STACK_GROWS_DOWN
+  char *sp = CURRENT_STACK_FRAME;
+  size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
+#else
+# error "to do"
+#endif
+  assert (freesize < pd->stackblock_size);
+  if (freesize > PTHREAD_STACK_MIN)
+    madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
+
   /* If the thread is detached free the TCB.  */
   if (IS_DETACHED (pd))
     /* Free the TCB.  */

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h Tue Aug 25 08:16:23 2009
@@ -85,15 +85,17 @@
 /* We support priority inheritence.  */
 #define _POSIX_THREAD_PRIO_INHERIT	200809L
 
-/* We support priority inheritence for robust mutexes.  */
-#define _POSIX_THREAD_ROBUST_PRIO_INHERIT	200809L
-
 /* We support priority protection, though only for non-robust
    mutexes.  */
 #define _POSIX_THREAD_PRIO_PROTECT	200809L
 
+#ifdef __USE_XOPEN2K8
+/* We support priority inheritence for robust mutexes.  */
+# define _POSIX_THREAD_ROBUST_PRIO_INHERIT	200809L
+
 /* We do not support priority protection for robust mutexes.  */
-#define _POSIX_THREAD_ROBUST_PRIO_PROTECT	-1
+# define _POSIX_THREAD_ROBUST_PRIO_PROTECT	-1
+#endif
 
 /* We support POSIX.1b semaphores.  */
 #define _POSIX_SEMAPHORES	200809L

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S Tue Aug 25 08:16:23 2009
@@ -64,9 +64,9 @@
 
 	/* Get the address of the mutex used.  */
 	movq    dep_mutex(%r8), %rcx
-	movl	MUTEX_KIND(%rcx), %eax
-	andl	$(ROBUST_BIT|PI_BIT), %eax
-	cmpl	$PI_BIT, %eax
+	movl	MUTEX_KIND(%rcx), %r11d
+	andl	$(ROBUST_BIT|PI_BIT), %r11d
+	cmpl	$PI_BIT, %r11d
 	je	9f
 
 #ifdef __ASSUME_PRIVATE_FUTEX

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S Tue Aug 25 08:16:23 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -30,6 +30,7 @@
 	.type	__pthread_rwlock_rdlock,@function
 	.align	16
 __pthread_rwlock_rdlock:
+	cfi_startproc
 	xorq	%r10, %r10
 
 	/* Get the lock.  */
@@ -167,6 +168,7 @@
 	subq	$MUTEX, %rdi
 #endif
 	jmp	13b
+	cfi_endproc
 	.size	__pthread_rwlock_rdlock,.-__pthread_rwlock_rdlock
 
 	.globl	pthread_rwlock_rdlock

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S Tue Aug 25 08:16:23 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -29,6 +29,7 @@
 	.type	__pthread_rwlock_unlock,@function
 	.align	16
 __pthread_rwlock_unlock:
+	cfi_startproc
 	/* Get the lock.  */
 	movl	$1, %esi
 	xorl	%eax, %eax
@@ -119,7 +120,7 @@
 #endif
 	callq	__lll_unlock_wake
 	jmp	8b
-
+	cfi_endproc
 	.size	__pthread_rwlock_unlock,.-__pthread_rwlock_unlock
 
 	.globl	pthread_rwlock_unlock

Modified: trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
==============================================================================
--- trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S (original)
+++ trunk/libc/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S Tue Aug 25 08:16:23 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -30,6 +30,7 @@
 	.type	__pthread_rwlock_wrlock,@function
 	.align	16
 __pthread_rwlock_wrlock:
+	cfi_startproc
 	xorq	%r10, %r10
 
 	/* Get the lock.  */
@@ -155,6 +156,7 @@
 	subq	$MUTEX, %rdi
 #endif
 	jmp	13b
+	cfi_endproc
 	.size	__pthread_rwlock_wrlock,.-__pthread_rwlock_wrlock
 
 	.globl	pthread_rwlock_wrlock

Modified: trunk/libc/nptl_db/ChangeLog
==============================================================================
--- trunk/libc/nptl_db/ChangeLog (original)
+++ trunk/libc/nptl_db/ChangeLog Tue Aug 25 08:16:23 2009
@@ -1,3 +1,10 @@
+2009-08-23  Roland McGrath  <roland@xxxxxxxxxx>
+
+	* td_ta_map_lwp2thr.c (__td_ta_lookup_th_unique): Move ta_ok check
+	and LOG call back to ...
+	(td_ta_map_lwp2thr): ... here.
+	Reported by Maciej W. Rozycki <macro@xxxxxxxxxxxxxxxx>.
+
 2009-05-25  Aurelien Jarno  <aurelien@xxxxxxxxxxx>
 
 	[BZ #10200]

Modified: trunk/libc/nptl_db/td_ta_map_lwp2thr.c
==============================================================================
--- trunk/libc/nptl_db/td_ta_map_lwp2thr.c (original)
+++ trunk/libc/nptl_db/td_ta_map_lwp2thr.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Which thread is running on an LWP?
-   Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2003,2004,2007,2009 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
@@ -32,12 +32,6 @@
   td_err_e terr;
   prgregset_t regs;
   psaddr_t addr;
-
-  LOG ("td_ta_map_lwp2thr");
-
-  /* Test whether the TA parameter is ok.  */
-  if (! ta_ok (ta))
-    return TD_BADTA;
 
   if (ta->ta_howto == ta_howto_unknown)
     {
@@ -181,6 +175,12 @@
 {
   td_thragent_t *const ta = (td_thragent_t *) ta_arg;
 
+  LOG ("td_ta_map_lwp2thr");
+
+  /* Test whether the TA parameter is ok.  */
+  if (! ta_ok (ta))
+    return TD_BADTA;
+
   /* We cannot rely on thread registers and such information at all
      before __pthread_initialize_minimal has gotten far enough.  They
      sometimes contain garbage that would confuse us, left by the kernel

Modified: trunk/libc/posix/Makefile
==============================================================================
--- trunk/libc/posix/Makefile (original)
+++ trunk/libc/posix/Makefile Tue Aug 25 08:16:23 2009
@@ -93,7 +93,7 @@
 		   bug-regex8 bug-regex9 bug-regex10 bug-regex12 \
 		   bug-regex14 bug-regex15 \
 		   bug-regex21 bug-regex24 \
-		   bug-regex27 bug-regex28 \
+		   bug-regex27 bug-regex28 bug-regex29 \
 		   tst-nice tst-nanosleep \
 		   transbug \
 		   tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \

Modified: trunk/libc/posix/regcomp.c
==============================================================================
--- trunk/libc/posix/regcomp.c (original)
+++ trunk/libc/posix/regcomp.c Tue Aug 25 08:16:23 2009
@@ -2489,7 +2489,7 @@
 	  return elem;
 	}
 
-      if (BE (end != -1 && start > end, 0))
+      if (BE ((end != -1 && start > end) || token->type != OP_CLOSE_DUP_NUM, 0))
 	{
 	  /* First number greater than second.  */
 	  *err = REG_BADBR;

Modified: trunk/libc/posix/unistd.h
==============================================================================
--- trunk/libc/posix/unistd.h (original)
+++ trunk/libc/posix/unistd.h Tue Aug 25 08:16:23 2009
@@ -30,30 +30,58 @@
 /* These may be used to determine what facilities are present at compile time.
    Their values can be obtained at run time from `sysconf'.  */
 
+#ifdef __USE_XOPEN2K8
 /* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008.  */
-#define	_POSIX_VERSION	200809L
+# define _POSIX_VERSION	200809L
+#elif defined __USE_XOPEN2K
+/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001.  */
+# define _POSIX_VERSION	200112L
+#elif defined __USE_POSIX199506
+/* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995.  */
+# define _POSIX_VERSION	199506L
+#elif defined __USE_POSIX199309
+/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993.  */
+# define _POSIX_VERSION	199309L
+#else
+/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990.  */
+# define _POSIX_VERSION	199009L
+#endif
 
 /* These are not #ifdef __USE_POSIX2 because they are
    in the theoretically application-owned namespace.  */
 
+#ifdef __USE_XOPEN2K8
+# define __POSIX2_THIS_VERSION	200809L
 /* The utilities on GNU systems also correspond to this version.  */
-#define _POSIX2_VERSION	200809L
+#elif defined __USE_XOPEN2K
+/* The utilities on GNU systems also correspond to this version.  */
+# define __POSIX2_THIS_VERSION	200112L
+#elif defined __USE_POSIX199506
+/* The utilities on GNU systems also correspond to this version.  */
+# define __POSIX2_THIS_VERSION	199506L
+#else
+/* The utilities on GNU systems also correspond to this version.  */
+# define __POSIX2_THIS_VERSION	199209L
+#endif
+
+/* The utilities on GNU systems also correspond to this version.  */
+#define _POSIX2_VERSION	__POSIX2_THIS_VERSION
 
 /* If defined, the implementation supports the
    C Language Bindings Option.  */
-#define	_POSIX2_C_BIND	200809L
+#define	_POSIX2_C_BIND	__POSIX2_THIS_VERSION
 
 /* If defined, the implementation supports the
    C Language Development Utilities Option.  */
-#define	_POSIX2_C_DEV	200809L
+#define	_POSIX2_C_DEV	__POSIX2_THIS_VERSION
 
 /* If defined, the implementation supports the
    Software Development Utilities Option.  */
-#define	_POSIX2_SW_DEV	200809L
+#define	_POSIX2_SW_DEV	__POSIX2_THIS_VERSION
 
 /* If defined, the implementation supports the
    creation of locales with the localedef utility.  */
-#define _POSIX2_LOCALEDEF       200809L
+#define _POSIX2_LOCALEDEF       __POSIX2_THIS_VERSION
 
 /* X/Open version number to which the library conforms.  It is selectable.  */
 #ifdef __USE_XOPEN2K8

Modified: trunk/libc/scripts/gen-as-const.awk
==============================================================================
--- trunk/libc/scripts/gen-as-const.awk (original)
+++ trunk/libc/scripts/gen-as-const.awk Tue Aug 25 08:16:23 2009
@@ -16,7 +16,8 @@
   if (test) {
     print "\n#include <inttypes.h>";
     print "\n#include <stdio.h>";
-    print "\n#if __WORDSIZE__ == 64";
+    print "\n#include <bits/wordsize.h>";
+    print "\n#if __WORDSIZE == 64";
     print "\ntypedef uint64_t c_t;";
     print "\n#define U(n) UINT64_C (n)";
     print "\n#define PRI PRId64";

Modified: trunk/libc/stdio-common/printf_fp.c
==============================================================================
--- trunk/libc/stdio-common/printf_fp.c (original)
+++ trunk/libc/stdio-common/printf_fp.c Tue Aug 25 08:16:23 2009
@@ -28,6 +28,7 @@
 #include <float.h>
 #include <gmp-mparam.h>
 #include <gmp.h>
+#include <ieee754.h>
 #include <stdlib/gmp-impl.h>
 #include <stdlib/longlong.h>
 #include <stdlib/fpioconst.h>
@@ -357,6 +358,8 @@
       /* Check for special values: not a number or infinity.  */
       if (__isnanl (fpnum.ldbl))
 	{
+	  union ieee854_long_double u = { .d = fpnum.ldbl };
+	  is_neg = u.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -367,10 +370,10 @@
 		special = "nan";
 		wspecial = L"nan";
 	      }
-	  is_neg = 0;
 	}
       else if (__isinfl (fpnum.ldbl))
 	{
+	  is_neg = fpnum.ldbl < 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "INF";
@@ -381,7 +384,6 @@
 	      special = "inf";
 	      wspecial = L"inf";
 	    }
-	  is_neg = fpnum.ldbl < 0;
 	}
       else
 	{
@@ -401,7 +403,8 @@
       /* Check for special values: not a number or infinity.  */
       if (__isnan (fpnum.dbl))
 	{
-	  is_neg = 0;
+	  union ieee754_double u = { .d = fpnum.dbl };
+	  is_neg = u.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";

Modified: trunk/libc/stdio-common/printf_fphex.c
==============================================================================
--- trunk/libc/stdio-common/printf_fphex.c (original)
+++ trunk/libc/stdio-common/printf_fphex.c Tue Aug 25 08:16:23 2009
@@ -185,6 +185,7 @@
       /* Check for special values: not a number or infinity.  */
       if (__isnanl (fpnum.ldbl.d))
 	{
+	  negative = fpnum.ldbl.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -195,7 +196,6 @@
 	      special = "nan";
 	      wspecial = L"nan";
 	    }
-	  negative = 0;
 	}
       else
 	{
@@ -224,6 +224,7 @@
       /* Check for special values: not a number or infinity.  */
       if (__isnan (fpnum.dbl.d))
 	{
+	  negative = fpnum.dbl.ieee.negative != 0;
 	  if (isupper (info->spec))
 	    {
 	      special = "NAN";
@@ -234,7 +235,6 @@
 	      special = "nan";
 	      wspecial = L"nan";
 	    }
-	  negative = 0;
 	}
       else
 	{

Modified: trunk/libc/stdio-common/tstdiomisc.c
==============================================================================
--- trunk/libc/stdio-common/tstdiomisc.c (original)
+++ trunk/libc/stdio-common/tstdiomisc.c Tue Aug 25 08:16:23 2009
@@ -47,34 +47,132 @@
 }
 
 volatile double nanval;
+volatile double infval;
+volatile long double lnanval;
+volatile long double linfval;
 
 
 static int
 F (void)
 {
-  char buf[20];
-  wchar_t wbuf[10];
+  char buf[80];
+  wchar_t wbuf[40];
   int result;
 
   nanval = NAN;
 
-  snprintf (buf, sizeof buf, "%f %F", nanval, nanval);
-  result = strcmp (buf, "nan NAN") != 0;
-  printf ("expected \"nan NAN\", got \"%s\"\n", buf);
+  snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
+	    nanval, nanval, nanval, nanval, nanval, nanval, nanval, nanval);
+  result = strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0;
+  printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf);
 
-  snprintf (buf, sizeof buf, "%f %F", DBL_MAX * DBL_MAX, DBL_MAX * DBL_MAX);
-  result |= strcmp (buf, "inf INF") != 0;
-  printf ("expected \"inf INF\", got \"%s\"\n", buf);
+  snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
+	    -nanval, -nanval, -nanval, -nanval,
+	    -nanval, -nanval, -nanval, -nanval);
+  result = strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
+  printf ("expected \"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got \"%s\"\n",
+	  buf);
+
+  infval = DBL_MAX * DBL_MAX;
+
+  snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
+	    infval, infval, infval, infval, infval, infval, infval, infval);
+  result |= strcmp (buf, "inf INF inf INF inf INF inf INF") != 0;
+  printf ("expected \"inf INF inf INF inf INF inf INF\", got \"%s\"\n", buf);
+
+  snprintf (buf, sizeof buf, "%a %A %e %E %f %F %g %G",
+	    -infval, -infval, -infval, -infval,
+	    -infval, -infval, -infval, -infval);
+  result |= strcmp (buf, "-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+  printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
+	  buf);
 
 #if __OPTION_POSIX_C_LANG_WIDE_CHAR
-  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F", nanval, nanval);
-  result |= wcscmp (wbuf, L"nan NAN") != 0;
-  printf ("expected L\"nan NAN\", got L\"%S\"\n", wbuf);
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+	    nanval, nanval, nanval, nanval, nanval, nanval, nanval, nanval);
+  result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
+  printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
 
-  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%f %F",
-	    DBL_MAX * DBL_MAX, DBL_MAX * DBL_MAX);
-  result |= wcscmp (wbuf, L"inf INF") != 0;
-  printf ("expected L\"inf INF\", got L\"%S\"\n", wbuf);
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+	    -nanval, -nanval, -nanval, -nanval,
+	    -nanval, -nanval, -nanval, -nanval);
+  result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
+  printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
+	  wbuf);
+
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+	    infval, infval, infval, infval, infval, infval, infval, infval);
+  result |= wcscmp (wbuf, L"inf INF inf INF inf INF inf INF") != 0;
+  printf ("expected L\"inf INF inf INF inf INF inf INF\", got L\"%S\"\n", wbuf);
+
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+	    -infval, -infval, -infval, -infval,
+	    -infval, -infval, -infval, -infval);
+  result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+  printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
+	  wbuf);
+#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+
+  lnanval = NAN;
+
+  snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    lnanval, lnanval, lnanval, lnanval,
+	    lnanval, lnanval, lnanval, lnanval);
+  result = strcmp (buf, "nan NAN nan NAN nan NAN nan NAN") != 0;
+  printf ("expected \"nan NAN nan NAN nan NAN nan NAN\", got \"%s\"\n", buf);
+
+  snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    -lnanval, -lnanval, -lnanval, -lnanval,
+	    -lnanval, -lnanval, -lnanval, -lnanval);
+  result = strcmp (buf, "-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
+  printf ("expected \"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got \"%s\"\n",
+	  buf);
+
+  linfval = LDBL_MAX * LDBL_MAX;
+
+  snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    linfval, linfval, linfval, linfval,
+	    linfval, linfval, linfval, linfval);
+  result |= strcmp (buf, "inf INF inf INF inf INF inf INF") != 0;
+  printf ("expected \"inf INF inf INF inf INF inf INF\", got \"%s\"\n", buf);
+
+  snprintf (buf, sizeof buf, "%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    -linfval, -linfval, -linfval, -linfval,
+	    -linfval, -linfval, -linfval, -linfval);
+  result |= strcmp (buf, "-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+  printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
+	  buf);
+
+#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+	    L"%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    lnanval, lnanval, lnanval, lnanval,
+	    lnanval, lnanval, lnanval, lnanval);
+  result |= wcscmp (wbuf, L"nan NAN nan NAN nan NAN nan NAN") != 0;
+  printf ("expected L\"nan NAN nan NAN nan NAN nan NAN\", got L\"%S\"\n", wbuf);
+
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+	    L"%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    -lnanval, -lnanval, -lnanval, -lnanval,
+	    -lnanval, -lnanval, -lnanval, -lnanval);
+  result |= wcscmp (wbuf, L"-nan -NAN -nan -NAN -nan -NAN -nan -NAN") != 0;
+  printf ("expected L\"-nan -NAN -nan -NAN -nan -NAN -nan -NAN\", got L\"%S\"\n",
+	  wbuf);
+
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+	    L"%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    linfval, linfval, linfval, linfval,
+	    linfval, linfval, linfval, linfval);
+  result |= wcscmp (wbuf, L"inf INF inf INF inf INF inf INF") != 0;
+  printf ("expected L\"inf INF inf INF inf INF inf INF\", got L\"%S\"\n", wbuf);
+
+  swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+	    L"%La %LA %Le %LE %Lf %LF %Lg %LG",
+	    -linfval, -linfval, -linfval, -linfval,
+	    -linfval, -linfval, -linfval, -linfval);
+  result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+  printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
+	  wbuf);
 #endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
 
   return result;

Modified: trunk/libc/stdlib/longlong.h
==============================================================================
--- trunk/libc/stdlib/longlong.h (original)
+++ trunk/libc/stdlib/longlong.h Tue Aug 25 08:16:23 2009
@@ -1,6 +1,6 @@
 /* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
    Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+   2002, 2003, 2004, 2005, 2006, 2009 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.
 
@@ -918,7 +918,7 @@
 "	or r1,%0"							\
 	: "=r" (q), "=&z" (r)						\
 	: "1" (n1), "r" (n0), "rm" (d), "r" (&__udiv_qrnnd_16)		\
-	: "r1", "r2", "r4", "r5", "r6", "pr");				\
+	: "r1", "r2", "r4", "r5", "r6", "pr", "t");			\
   } while (0)
 
 #define UDIV_TIME 80
@@ -926,7 +926,8 @@
 #define sub_ddmmss(sh, sl, ah, al, bh, bl)				\
   __asm__ ("clrt;subc %5,%1; subc %4,%0"				\
 	   : "=r" (sh), "=r" (sl)					\
-	   : "0" (ah), "1" (al), "r" (bh), "r" (bl))
+	   : "0" (ah), "1" (al), "r" (bh), "r" (bl)			\
+	   : "t")
 
 #endif /* __sh__ */
 

Modified: trunk/libc/sysdeps/generic/elf/backtracesyms.c
==============================================================================
--- trunk/libc/sysdeps/generic/elf/backtracesyms.c (original)
+++ trunk/libc/sysdeps/generic/elf/backtracesyms.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Return list with names for address in backtrace.
-   Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc.
+   Copyright (C) 1998,1999,2000,2001,2003,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -48,15 +48,22 @@
   /* Fill in the information we can get from `dladdr'.  */
   for (cnt = 0; cnt < size; ++cnt)
     {
-      status[cnt] = _dl_addr (array[cnt], &info[cnt], NULL, NULL);
+      struct link_map *map;
+      status[cnt] = _dl_addr (array[cnt], &info[cnt], &map, NULL);
       if (status[cnt] && info[cnt].dli_fname && info[cnt].dli_fname[0] != '\0')
-	/* We have some info, compute the length of the string which will be
-	   "<file-name>(<sym-name>) [+offset].  */
-	total += (strlen (info[cnt].dli_fname ?: "")
-		  + (info[cnt].dli_sname
-		     ? strlen (info[cnt].dli_sname) + 3 + WORD_WIDTH + 3
-		     : 1)
-		  + WORD_WIDTH + 5);
+	{
+	  /* We have some info, compute the length of the string which will be
+	     "<file-name>(<sym-name>+offset) [address].  */
+	  total += (strlen (info[cnt].dli_fname ?: "")
+		    + strlen (info[cnt].dli_sname ?: "")
+		    + 3 + WORD_WIDTH + 3 + WORD_WIDTH + 5);
+
+	  /* The load bias is more useful to the user than the load
+	     address.  The use of these addresses is to calculate an
+	     address in the ELF file, so its prelinked bias is not
+	     something we want to subtract out.  */
+	  info[cnt].dli_fbase = (void *) map->l_addr;
+	}
       else
 	total += 5 + WORD_WIDTH;
     }
@@ -71,25 +78,39 @@
 	{
 	  result[cnt] = last;
 
-	  if (status[cnt] && info[cnt].dli_fname
-	      && info[cnt].dli_fname[0] != '\0')
+	  if (status[cnt]
+	      && info[cnt].dli_fname != NULL && info[cnt].dli_fname[0] != '\0')
 	    {
-	      char buf[20];
+	      if (info[cnt].dli_sname == NULL)
+		/* We found no symbol name to use, so describe it as
+		   relative to the file.  */
+		info[cnt].dli_saddr = info[cnt].dli_fbase;
 
-	      if (array[cnt] >= (void *) info[cnt].dli_saddr)
-		sprintf (buf, "+%#lx",
-			 (unsigned long)(array[cnt] - info[cnt].dli_saddr));
+	      if (info[cnt].dli_sname == NULL && info[cnt].dli_saddr == 0)
+		last += 1 + sprintf (last, "%s(%s) [%p]",
+				     info[cnt].dli_fname ?: "",
+				     info[cnt].dli_sname ?: "",
+				     array[cnt]);
 	      else
-		sprintf (buf, "-%#lx",
-			 (unsigned long)(info[cnt].dli_saddr - array[cnt]));
+		{
+		  char sign;
+		  ptrdiff_t offset;
+		  if (array[cnt] >= (void *) info[cnt].dli_saddr)
+		    {
+		      sign = '+';
+		      offset = array[cnt] - info[cnt].dli_saddr;
+		    }
+		  else
+		    {
+		      sign = '-';
+		      offset = info[cnt].dli_saddr - array[cnt];
+		    }
 
-	      last += 1 + sprintf (last, "%s%s%s%s%s[%p]",
-				   info[cnt].dli_fname ?: "",
-				   info[cnt].dli_sname ? "(" : "",
-				   info[cnt].dli_sname ?: "",
-				   info[cnt].dli_sname ? buf : "",
-				   info[cnt].dli_sname ? ") " : " ",
-				   array[cnt]);
+		  last += 1 + sprintf (last, "%s(%s%c%#tx) [%p]",
+				       info[cnt].dli_fname ?: "",
+				       info[cnt].dli_sname ?: "",
+				       sign, offset, array[cnt]);
+		}
 	    }
 	  else
 	    last += 1 + sprintf (last, "[%p]", array[cnt]);

Modified: trunk/libc/sysdeps/generic/elf/backtracesymsfd.c
==============================================================================
--- trunk/libc/sysdeps/generic/elf/backtracesymsfd.c (original)
+++ trunk/libc/sysdeps/generic/elf/backtracesymsfd.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Write formatted list with names for addresses in backtrace to a file.
-   Copyright (C) 1998, 2000, 2003, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998,2000,2003,2005,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -46,47 +46,63 @@
     {
       char buf[WORD_WIDTH];
       Dl_info info;
+      struct link_map *map;
       size_t last = 0;
 
-      if (_dl_addr (array[cnt], &info, NULL, NULL)
-	  && info.dli_fname && info.dli_fname[0] != '\0')
+      if (_dl_addr (array[cnt], &info, &map, NULL)
+	  && info.dli_fname != NULL && info.dli_fname[0] != '\0')
 	{
 	  /* Name of the file.  */
 	  iov[0].iov_base = (void *) info.dli_fname;
 	  iov[0].iov_len = strlen (info.dli_fname);
 	  last = 1;
 
-	  /* Symbol name.  */
-	  if (info.dli_sname != NULL)
+	  if (info.dli_sname != NULL || map->l_addr != 0)
 	    {
 	      char buf2[WORD_WIDTH];
 	      size_t diff;
 
-	      iov[1].iov_base = (void *) "(";
-	      iov[1].iov_len = 1;
-	      iov[2].iov_base = (void *) info.dli_sname;
-	      iov[2].iov_len = strlen (info.dli_sname);
+	      iov[last].iov_base = (void *) "(";
+	      iov[last].iov_len = 1;
+	      ++last;
+
+	      if (info.dli_sname != NULL)
+		{
+		  /* We have a symbol name.  */
+		  iov[last].iov_base = (void *) info.dli_sname;
+		  iov[last].iov_len = strlen (info.dli_sname);
+		  ++last;
+		}
+	      else
+		/* We have no symbol, so describe it as relative to the file.
+		   The load bias is more useful to the user than the load
+		   address.  The use of these addresses is to calculate an
+		   address in the ELF file, so its prelinked bias is not
+		   something we want to subtract out.  */
+		info.dli_saddr = (void *) map->l_addr;
 
 	      if (array[cnt] >= (void *) info.dli_saddr)
 		{
-		  iov[3].iov_base = (void *) "+0x";
+		  iov[last].iov_base = (void *) "+0x";
 		  diff = array[cnt] - info.dli_saddr;
 		}
 	      else
 		{
-		  iov[3].iov_base = (void *) "-0x";
+		  iov[last].iov_base = (void *) "-0x";
 		  diff = info.dli_saddr - array[cnt];
 		}
-	      iov[3].iov_len = 3;
+	      iov[last].iov_len = 3;
+	      ++last;
 
-	      iov[4].iov_base = _itoa_word ((unsigned long int) diff,
-					    &buf2[WORD_WIDTH], 16, 0);
-	      iov[4].iov_len = &buf2[WORD_WIDTH] - (char *) iov[4].iov_base;
+	      iov[last].iov_base = _itoa_word ((unsigned long int) diff,
+					       &buf2[WORD_WIDTH], 16, 0);
+	      iov[last].iov_len = (&buf2[WORD_WIDTH]
+				   - (char *) iov[last].iov_base);
+	      ++last;
 
-	      iov[5].iov_base = (void *) ")";
-	      iov[5].iov_len = 1;
-
-	      last = 6;
+	      iov[last].iov_base = (void *) ")";
+	      iov[last].iov_len = 1;
+	      ++last;
 	    }
 	}
 

Modified: trunk/libc/sysdeps/i386/fpu/bits/mathinline.h
==============================================================================
--- trunk/libc/sysdeps/i386/fpu/bits/mathinline.h (original)
+++ trunk/libc/sysdeps/i386/fpu/bits/mathinline.h Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Inline math functions for i387.
-   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2003,2004,2006,2007
+   Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2003,2004,2006,2007,2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by John C. Bowman <bowman@xxxxxxxxxxxxxxxx>, 1995.
@@ -152,6 +152,10 @@
 
 #if ((!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
      && defined __OPTIMIZE__)
+
+/* The inline functions do not set errno or raise necessarily the
+   correct exceptions.  */
+# undef math_errhandling
 
 /* A macro to define float, double, and long double versions of various
    math functions for the ix87 FPU.  FUNC is the function name (which will

Modified: trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S (original)
+++ trunk/libc/sysdeps/powerpc/powerpc32/__longjmp-common.S Tue Aug 25 08:16:23 2009
@@ -33,6 +33,13 @@
 
 #if defined PTR_DEMANGLE || defined CHECK_SP
 	lwz r24,(JB_GPR1*4)(r3)
+# ifdef CHECK_SP
+#  ifdef PTR_DEMANGLE
+	PTR_DEMANGLE3 (r24, r24, r25)
+#  endif
+	CHECK_SP (r24)
+	mr r1,r24
+# endif
 #else
 	lwz r1,(JB_GPR1*4)(r3)
 #endif
@@ -45,16 +52,10 @@
 	lwz r19,((JB_GPRS+5)*4)(r3)
 	lwz r20,((JB_GPRS+6)*4)(r3)
 #ifdef PTR_DEMANGLE
-# ifdef CHECK_SP
-	PTR_DEMANGLE3 (r24, r24, r25)
-# else
+# ifndef CHECK_SP
 	PTR_DEMANGLE3 (r1, r24, r25)
 # endif
 	PTR_DEMANGLE2 (r0, r25)
-#endif
-#ifdef CHECK_SP
-	CHECK_SP (r24)
-	mr r1,r24
 #endif
 	mtlr r0
 	lwz r21,((JB_GPRS+7)*4)(r3)

Modified: trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S
==============================================================================
--- trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S (original)
+++ trunk/libc/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S Tue Aug 25 08:16:23 2009
@@ -116,6 +116,13 @@
 #endif
 #if defined PTR_DEMANGLE || defined CHECK_SP
 	lwz r24,(JB_GPR1*4)(r3)
+# ifdef CHECK_SP
+#  ifdef PTR_DEMANGLE
+	PTR_DEMANGLE3 (r24, r24, r25)
+#  endif
+	CHECK_SP (r24)
+	mr r1,r24
+# endif
 #else
 	lwz r1,(JB_GPR1*4)(r3)
 #endif
@@ -135,16 +142,10 @@
 	lwz r20,((JB_GPRS+6)*4)(r3)
 	lfd fp20,((JB_FPRS+6*2)*4)(r3)
 #ifdef PTR_DEMANGLE
-# ifdef CHECK_SP
-	PTR_DEMANGLE3 (r24, r24, r25)
-# else
+# ifndef CHECK_SP
 	PTR_DEMANGLE3 (r1, r24, r25)
 # endif
 	PTR_DEMANGLE2 (r0, r25)
-#endif
-#ifdef CHECK_SP
-	CHECK_SP (r24)
-	mr r1,r24
 #endif
 	mtlr r0
 	lwz r21,((JB_GPRS+7)*4)(r3)

Modified: trunk/libc/sysdeps/unix/Makefile
==============================================================================
--- trunk/libc/sysdeps/unix/Makefile (original)
+++ trunk/libc/sysdeps/unix/Makefile Tue Aug 25 08:16:23 2009
@@ -1,4 +1,4 @@
-# Copyright (C) 1991,1992,1993,1994,1995,1996,1997,1998,1999,2003, 2006, 2008
+# Copyright (C) 1991,1992,1993,1994,1995,1996,1997,1998,1999,2003,2006,2008,2009
 #	Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
@@ -260,7 +260,6 @@
 # which specifies objects to be compiled as simple Unix system calls.
 
 -include $(common-objpfx)sysd-syscalls
-omit-deps += $(foreach t,$(sysd-rules-targets),$(unix-syscalls:%=$t))
 
 ifeq (misc,$(subdir))
 sysdep_routines += $(unix-extra-syscalls)
@@ -306,9 +305,9 @@
 endif
 
 # This is the end of the pipeline for compiling the syscall stubs.
-# The stdin in assembler with cpp using sysdep.h macros.
-# Be sure to disable debugging info since it would all just say "<stdin>".
-compile-syscall = $(filter-out -g%,$(COMPILE.S)) -x assembler-with-cpp -o $@ -
+# The stdin is assembler with cpp using sysdep.h macros.
+compile-syscall = $(COMPILE.S) -o $@ -x assembler-with-cpp - \
+			       $(compile-mkdep-flags)
 
 ifndef avoid-generated
 $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
@@ -323,16 +322,13 @@
 	mv -f $@T $@
 endif
 
-# The syscall objects depend on s-proto.d or s-proto-cancel.d, which
-# are generated to specify dependencies generated syscalls have on
-# headers.
+# The $(bppfx)syscall.ob objects depend on s-proto-bp.d, which are
+# generated to specify dependencies generated BP stubs have on headers.
 # These deps use file names relative to a subdir, so don't
 # include them in the parent directory.
 ifneq (,$(filter $(unix-syscalls),$(routines) $(sysdep_routines) $(aux)))
 ifndef no_deps
--include $(common-objpfx)s-proto.d
 -include $(common-objpfx)s-proto-bp.d
--include $(common-objpfx)s-proto-cancel.d
 endif
 endif
 
@@ -340,7 +336,7 @@
 		       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
 	$(+make-deps)
 
-common-generated += s-proto.d s-proto-bp.d s-proto-cancel.d
+common-generated += s-proto-bp.d
 postclean-generated += sysd-syscalls
 
 endif

Modified: trunk/libc/sysdeps/unix/make-syscalls.sh
==============================================================================
--- trunk/libc/sysdeps/unix/make-syscalls.sh (original)
+++ trunk/libc/sysdeps/unix/make-syscalls.sh Tue Aug 25 08:16:23 2009
@@ -83,12 +83,13 @@
   ;;
   esac
 
-  cancellable=
-  noerrno=
+  cancellable=0
+  noerrno=0
+  errval=0
   case $args in
-  C*) cancellable=-cancel; args=`echo $args | sed 's/C:\?//'`;;
-  E*) noerrno=_NOERRNO; args=`echo $args | sed 's/E:\?//'`;;
-  V*) noerrno=_ERRVAL; args=`echo $args | sed 's/V:\?//'`;;
+  C*) cancellable=1; args=`echo $args | sed 's/C:\?//'`;;
+  E*) noerrno=1; args=`echo $args | sed 's/E:\?//'`;;
+  V*) errval=1; args=`echo $args | sed 's/V:\?//'`;;
   esac
 
   # Derive the number of arguments from the argument signature
@@ -115,7 +116,7 @@
  x--)
   # Undefined callnum for an extra syscall.
   if [ x$caller != x- ]; then
-    if [ x$noerrno != x ]; then
+    if [ $noerrno != 0 ]; then
       echo >&2 "$0: no number for $fileno, no-error syscall ($strong $weak)"
       exit 2
     fi
@@ -151,7 +152,7 @@
     ;;
   esac
 
-  echo "		\$(common-objpfx)s-proto$cancellable.d"
+  echo "		\$(..)sysdeps/unix/make-syscalls.sh"
   case x"$callnum" in
   x_)
   echo "\
@@ -161,11 +162,17 @@
   x*)
   echo "\
 	\$(make-target-directory)
-	(echo '#include <sysdep$cancellable.h>'; \\
-	 echo 'PSEUDO$noerrno ($strong, $syscall, $nargs)'; \\
-	 echo '	ret$noerrno'; \\
-	 echo 'PSEUDO_END$noerrno($strong)'; \\
-	 echo 'libc_hidden_def ($strong)'; \\"
+	(echo '#define SYSCALL_NAME $syscall'; \\
+	 echo '#define SYSCALL_NARGS $nargs'; \\
+	 echo '#define SYSCALL_SYMBOL $strong'; \\"
+  [ $cancellable = 0 ] || echo "\
+	 echo '#define SYSCALL_CANCELLABLE 1'; \\"
+  [ $noerrno = 0 ] || echo "\
+	 echo '#define SYSCALL_NOERRNO 1'; \\"
+  [ $errval = 0 ] || echo "\
+	 echo '#define SYSCALL_ERRVAL 1'; \\"
+  echo "\
+	 echo '#include <syscall-template.S>'; \\"
   ;;
   esac
 
@@ -201,7 +208,7 @@
 	  vcount=`expr $vcount + 1`
 	  echo "	 echo 'strong_alias ($strong, $source)'; \\"
 	fi
-	echo "	 echo 'symbol_version($source, $base, $ver)'; \\"
+	echo "	 echo 'symbol_version ($source, $base, $ver)'; \\"
 	;;
       !*)
 	name=`echo $name | sed 's/.//'`

Modified: trunk/libc/sysdeps/x86_64/fpu/bits/mathinline.h
==============================================================================
--- trunk/libc/sysdeps/x86_64/fpu/bits/mathinline.h (original)
+++ trunk/libc/sysdeps/x86_64/fpu/bits/mathinline.h Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Inline math functions for x86-64.
-   Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2007, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@xxxxxxx>, 2002.
 
@@ -35,14 +35,16 @@
 __MATH_INLINE int
 __NTH (__signbitf (float __x))
 {
-  __extension__ union { float __f; int __i; } __u = { __f: __x };
-  return __u.__i < 0;
+  int __m;
+  asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+  return __m & 0x8;
 }
 __MATH_INLINE int
 __NTH (__signbit (double __x))
 {
-  __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
-  return __u.__i[1] < 0;
+  int __m;
+  asm ("pmovmskb %1, %0" : "=r" (__m) : "x" (__x));
+  return __m & 0x80;
 }
 __MATH_INLINE int
 __NTH (__signbitl (long double __x))

Modified: trunk/libc/sysdeps/x86_64/fpu/math_private.h
==============================================================================
--- trunk/libc/sysdeps/x86_64/fpu/math_private.h (original)
+++ trunk/libc/sysdeps/x86_64/fpu/math_private.h Tue Aug 25 08:16:23 2009
@@ -18,4 +18,41 @@
 while (0)
 
 #include <math/math_private.h>
+
+/* We can do a few things better on x86-64.  */
+
+/* Direct movement of float into integer register.  */
+#undef EXTRACT_WORDS64
+#define EXTRACT_WORDS64(i,d)					\
+do {								\
+  long int i_;							\
+  asm ("movd %1, %0" : "=rm" (i_) : "x" (d));			\
+  (i) = i_;							\
+} while (0)
+
+/* And the reverse.  */
+#undef INSERT_WORDS64
+#define INSERT_WORDS64(d,i) \
+do {								\
+  long int i_ = i;						\
+  asm ("movd %1, %0" : "=x" (d) : "rm" (i_));			\
+} while (0)
+
+/* Direct movement of float into integer register.  */
+#undef GET_FLOAT_WORD
+#define GET_FLOAT_WORD(i,d) \
+do {								\
+  int i_;							\
+  asm ("movd %1, %0" : "=rm" (i_) : "x" (d));			\
+  (i) = i_;							\
+} while (0)
+
+/* And the reverse.  */
+#undef SET_FLOAT_WORD
+#define SET_FLOAT_WORD(d,i) \
+do {								\
+  int i_ = i;							\
+  asm ("movd %1, %0" : "=x" (d) : "rm" (i_));			\
+} while (0)
+
 #endif

Modified: trunk/libc/test-skeleton.c
==============================================================================
--- trunk/libc/test-skeleton.c (original)
+++ trunk/libc/test-skeleton.c Tue Aug 25 08:16:23 2009
@@ -1,5 +1,5 @@
 /* Skeleton for test programs.
-   Copyright (C) 1998,2000-2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1998,2000-2004, 2005, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1998.
 
@@ -132,7 +132,7 @@
 /* Timeout handler.  We kill the child and exit with an error.  */
 static void
 __attribute__ ((noreturn))
-timeout_handler (int sig __attribute__ ((unused)))
+signal_handler (int sig __attribute__ ((unused)))
 {
   int killed;
   int status;
@@ -166,6 +166,12 @@
 #ifdef CLEANUP_HANDLER
   CLEANUP_HANDLER;
 #endif
+
+  if (sig == SIGINT)
+    {
+      signal (sig, SIG_DFL);
+      raise (sig);
+    }
 
   /* If we expected this signal: good!  */
 #ifdef EXPECTED_SIGNAL
@@ -325,8 +331,11 @@
   /* Default timeout is two seconds.  */
 # define TIMEOUT 2
 #endif
-  signal (SIGALRM, timeout_handler);
+  signal (SIGALRM, signal_handler);
   alarm (TIMEOUT * timeoutfactor);
+
+  /* Make sure we clean up if the wrapper gets interrupted.  */
+  signal (SIGINT, signal_handler);
 
   /* Wait for the regular termination.  */
   termpid = TEMP_FAILURE_RETRY (waitpid (pid, &status, 0));