This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] intl: reintroduce unintentionally disabled optimization


HAVE_BUILTIN_EXPECT macro was removed by commit glibc-2.14-280-g3ce1f29,
but then unintentionally reintroduced during merge with GNU gettext
0.19.3 by commit glibc-2.20-324-g6d24885, effectively disabling all
optimization based on __builtin_expect.  As intl files are also part
of GNU gettext, HAVE_BUILTIN_EXPECT macro cannot be removed, so guard
its use with _LIBC macro.

[BZ #19512]
* intl/gettextP.h (__builtin_expect): Define only if
[!_LIBC && !HAVE_BUILTIN_EXPECT].
* intl/loadinfo.h (__builtin_expect): Likewise.
---
 intl/gettextP.h | 2 +-
 intl/loadinfo.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/intl/gettextP.h b/intl/gettextP.h
index 8c74bc5..83d9395 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -99,7 +99,7 @@ extern char *libintl_dcigettext (const char *__domainname,
 
 /* Tell the compiler when a conditional or integer expression is
    almost always true or almost always false.  */
-#ifndef HAVE_BUILTIN_EXPECT
+#if !defined _LIBC && !defined HAVE_BUILTIN_EXPECT
 # define __builtin_expect(expr, val) (expr)
 #endif
 
diff --git a/intl/loadinfo.h b/intl/loadinfo.h
index 2e15f93..025fc3a 100644
--- a/intl/loadinfo.h
+++ b/intl/loadinfo.h
@@ -40,7 +40,7 @@
 
 /* Tell the compiler when a conditional or integer expression is
    almost always true or almost always false.  */
-#ifndef HAVE_BUILTIN_EXPECT
+#if !defined _LIBC && !defined HAVE_BUILTIN_EXPECT
 # define __builtin_expect(expr, val) (expr)
 #endif
 
-- 
ldv


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]