about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--libio/bits/stdio.h9
-rw-r--r--libio/stdio.h4
-rw-r--r--linuxthreads/pthread.c5
4 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index bb7aaab2f6..dba37e392b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2001-01-08  Ulrich Drepper  <drepper@redhat.com>
+
+	* libio/bits/stdio.h (printf): Define macro to map printf call to
+	fprintf which gcc can optimize.
+
 2001-01-07  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/generic/bits/byteswap.h (__bswap_64): Partly revert last
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index 2522a3846e..0b4f614221 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -1,5 +1,5 @@
 /* Optimizing macros and inline functions for stdio functions.
-   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2001 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -28,6 +28,13 @@
 
 
 #ifdef __USE_EXTERN_INLINES
+/* Since version 2.97 GCC knows about `fprintf' and can optimize certain
+   cases.  Help gcc to optimize more code by mapping `printf' to the known
+   `fprintf' function.  Unfortunately we have to use a macro.  */
+# if __GNUC_PREREQ (2,97)
+#  define printf(fmt, args...) fprintf (stdout, fmt, ##args)
+# endif
+
 /* Write formatted output to stdout from argument list ARG.  */
 __STDIO_INLINE int
 vprintf (__const char *__restrict __fmt, _G_va_list __arg) __THROW
diff --git a/libio/stdio.h b/libio/stdio.h
index 4fcc3b309d..c8565e815b 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -1,5 +1,5 @@
 /* Define ISO C stdio on top of C++ iostreams.
-   Copyright (C) 1991, 1994-1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1994-1999, 2000, 2001 Free Software Foundation, Inc.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -637,7 +637,7 @@ extern void funlockfile (FILE *__stream) __THROW;
 #endif	/* X/Open, but not issue 6 and not for GNU.  */
 
 /* If we are compiling with optimizing read this file.  It contains
-   several optizing inline functions and macros.  */
+   several optimizing inline functions and macros.  */
 #ifdef __USE_EXTERN_INLINES
 # include <bits/stdio.h>
 #endif
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index 75cac05ac0..836d8a81e1 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -740,7 +740,10 @@ static void pthread_exit_process(int retcode, void *arg)
     /* Main thread should accumulate times for thread manager and its
        children, so that timings for main thread account for all threads. */
     if (self == __pthread_main_thread)
-      waitpid(__pthread_manager_thread.p_pid, NULL, __WCLONE);
+      {
+	waitpid(__pthread_manager_thread.p_pid, NULL, __WCLONE);
+	free (__pthread_manager_thread_bos);
+      }
   }
 }