Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 12 Aug 2003 03:41:23 +0000 (03:41 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 12 Aug 2003 03:41:23 +0000 (03:41 +0000)
2003-08-11  Ulrich Drepper  <drepper@redhat.com>

* assert/assert.h: Use __builtin_expect in assert and
assert_perror definitions if possible.

ChangeLog
assert/assert.h
linuxthreads/ChangeLog
linuxthreads/manager.c

index f3dbab4adde5ebc38e031eb1b4f316fb526a201a..cb4b111274eed4e9e6285ca3d09b3a0b9685772d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-11  Ulrich Drepper  <drepper@redhat.com>
+
+       * assert/assert.h: Use __builtin_expect in assert and
+       assert_perror definitions if possible.
+
 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/generic/ldsodefs.h (_rtld_global): Add
index 89e28b5453b5463d41949c36f860b087f85f635e..9908d4176a2961f6d56759fe3bafc6299ef58726 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,1992,1994-1999,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1994-2001,2003 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
@@ -84,16 +84,33 @@ extern void __assert (const char *__assertion, const char *__file, int __line)
 
 __END_DECLS
 
-# define assert(expr) \
+/* For the macro definition we use gcc's __builtin_expect if possible
+   to generate good code for the non-error case.  gcc 3.0 is a good
+   enough estimate for when the feature became available.  */
+# if __GNUC_PREREQ (3, 0)
+#  define assert(expr) \
+  (__ASSERT_VOID_CAST (__builtin_expect (expr, 1) ? 0 :                              \
+                      (__assert_fail (__STRING(expr), __FILE__, __LINE__,    \
+                                      __ASSERT_FUNCTION), 0)))
+# else
+#  define assert(expr) \
   (__ASSERT_VOID_CAST ((expr) ? 0 :                                          \
                       (__assert_fail (__STRING(expr), __FILE__, __LINE__,    \
                                       __ASSERT_FUNCTION), 0)))
+# endif
 
 # ifdef        __USE_GNU
-#  define assert_perror(errnum) \
+#  if __GNUC_PREREQ (3, 0)
+#   define assert_perror(errnum) \
   (__ASSERT_VOID_CAST (!(errnum) ? 0 :                                       \
                       (__assert_perror_fail ((errnum), __FILE__, __LINE__,   \
                                              __ASSERT_FUNCTION), 0)))
+#  else
+#   define assert_perror(errnum) \
+  (__ASSERT_VOID_CAST (__builtin_expect (!(errnum), 1) ? 0 :                 \
+                      (__assert_perror_fail ((errnum), __FILE__, __LINE__,   \
+                                             __ASSERT_FUNCTION), 0)))
+#  endif
 # endif
 
 /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
index 54d7e425acd7f1a92274fe829a5c76587cfb4b80..1fbaa1c793c046a141dd51b201a2d328e54bdfe9 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-11  Steven Munroe  <sjmunroe@us.ibm.com>
+
+       * manager.c (pthread_start_thread) [!(USE_TLS && HAVE___THREAD)]:
+       Correct spelling of per thread resolver state.
+
 2003-08-07  Jakub Jelinek  <jakub@redhat.com>
 
        * sysdeps/pthread/bits/libc-lock.h [_LIBC && SHARED]
index 9620b8b39c606744655dfef123b9c1485a1b084e..f8647b47ca3c07ddb8f395c614afa92860aef4b2 100644 (file)
@@ -290,7 +290,7 @@ pthread_start_thread(void *arg)
   __uselocale (LC_GLOBAL_LOCALE);
 #else
   /* Initialize __resp.  */
-  __resp = &self->p_resp;
+  __resp = &self->p_res;
 #endif
   /* Make gdb aware of new thread */
   if (__pthread_threads_debug && __pthread_sig_debug > 0) {