Message ID | 20160124181337.GA8527@altlinux.org |
---|---|
State | Accepted, archived |
Delegated to: | Dmitry Levin |
Headers |
Received: (qmail 72958 invoked by alias); 24 Jan 2016 18:13:43 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 72946 invoked by uid 89); 24 Jan 2016 18:13:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*r:508, 376, UD:h.in, config.h.in X-HELO: pegasus3.altlinux.org Date: Sun, 24 Jan 2016 21:13:38 +0300 From: "Dmitry V. Levin" <ldv@altlinux.org> To: libc-alpha@sourceware.org Subject: [PATCH v2] intl: reintroduce unintentionally disabled optimization Message-ID: <20160124181337.GA8527@altlinux.org> Mail-Followup-To: libc-alpha@sourceware.org References: <20160124000754.GA27321@altlinux.org> <m27fizbc0k.fsf@linux-m68k.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <m27fizbc0k.fsf@linux-m68k.org> |
Commit Message
Dmitry V. Levin
Jan. 24, 2016, 6:13 p.m. UTC
HAVE_BUILTIN_EXPECT macro was removed by commit glibc-2.14-280-g3ce1f29, but then its use was 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 define it unconditionally in config.h.in instead. [BZ #19512] * config.h.in (HAVE_BUILTIN_EXPECT): New macro. --- config.h.in | 5 +++++ 1 file changed, 5 insertions(+)
Comments
On 24 Jan 2016 21:13, Dmitry V. Levin wrote: > HAVE_BUILTIN_EXPECT macro was removed by commit glibc-2.14-280-g3ce1f29, > but then its use was 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 define > it unconditionally in config.h.in instead. > > [BZ #19512] > * config.h.in (HAVE_BUILTIN_EXPECT): New macro. > --- > config.h.in | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/config.h.in b/config.h.in > index ec9c8bc..13c0044 100644 > --- a/config.h.in > +++ b/config.h.in > @@ -37,6 +37,11 @@ > /* Define if static NSS modules are wanted. */ > #undef DO_STATIC_NSS > > +/* Assume that the compiler supports __builtin_expect. > + This macro is necessary for proper compilation of code > + shared between GNU libc and GNU gettext projects. */ > +#define HAVE_BUILTIN_EXPECT 1 > + > /* Define if the compiler supports __builtin_memset. */ > #undef HAVE_BUILTIN_MEMSET shouldn't this be an AC_DEFINE in configure.ac instead ? or do we not have a policy for that ? it doesn't matter *that* much as long as we avoid autoheader, although it would be nice if we didn't ... -mike
On Mon, Feb 22, 2016 at 04:17:46AM -0500, Mike Frysinger wrote: > On 24 Jan 2016 21:13, Dmitry V. Levin wrote: > > HAVE_BUILTIN_EXPECT macro was removed by commit glibc-2.14-280-g3ce1f29, > > but then its use was 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 define > > it unconditionally in config.h.in instead. > > > > [BZ #19512] > > * config.h.in (HAVE_BUILTIN_EXPECT): New macro. > > --- > > config.h.in | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/config.h.in b/config.h.in > > index ec9c8bc..13c0044 100644 > > --- a/config.h.in > > +++ b/config.h.in > > @@ -37,6 +37,11 @@ > > /* Define if static NSS modules are wanted. */ > > #undef DO_STATIC_NSS > > > > +/* Assume that the compiler supports __builtin_expect. > > + This macro is necessary for proper compilation of code > > + shared between GNU libc and GNU gettext projects. */ > > +#define HAVE_BUILTIN_EXPECT 1 > > + > > /* Define if the compiler supports __builtin_memset. */ > > #undef HAVE_BUILTIN_MEMSET > > shouldn't this be an AC_DEFINE in configure.ac instead ? > or do we not have a policy for that ? We certainly do have some macros defined directly in this file: $ grep '#define' config.h.in #define HAVE_IFUNC 0 #define HAVE_STRERROR 1 #define HAVE_REGEX 1 #define ARM_PCREL_MOVW_OK 0 #define HAVE_PT_CHOWN 0 #define HAVE_BUILTIN_TRAP 0 #define HAVE_PPC_FCFID 0 #define HAVE_PPC_FCTIDZ 0
"Dmitry V. Levin" <ldv@altlinux.org> writes: > We certainly do have some macros defined directly in this file: > $ grep '#define' config.h.in > #define HAVE_IFUNC 0 > #define HAVE_STRERROR 1 > #define HAVE_REGEX 1 > #define ARM_PCREL_MOVW_OK 0 > #define HAVE_PT_CHOWN 0 > #define HAVE_BUILTIN_TRAP 0 > #define HAVE_PPC_FCFID 0 > #define HAVE_PPC_FCTIDZ 0 Most of these (those defined to 0) are the templates used by AC_DEFINE. Andreas.
On Mon, Feb 22, 2016 at 01:51:02PM +0100, Andreas Schwab wrote: > > > We certainly do have some macros defined directly in this file: > > $ grep '#define' config.h.in > > #define HAVE_IFUNC 0 > > #define HAVE_STRERROR 1 > > #define HAVE_REGEX 1 > > #define ARM_PCREL_MOVW_OK 0 > > #define HAVE_PT_CHOWN 0 > > #define HAVE_BUILTIN_TRAP 0 > > #define HAVE_PPC_FCFID 0 > > #define HAVE_PPC_FCTIDZ 0 > > Most of these (those defined to 0) are the templates used by AC_DEFINE. OK, so what's the preferred way of adding new macros like HAVE_BUILTIN_EXPECT and HAVE_REGEX?
"Dmitry V. Levin" <ldv@altlinux.org> writes: > On Mon, Feb 22, 2016 at 01:51:02PM +0100, Andreas Schwab wrote: >> >> > We certainly do have some macros defined directly in this file: >> > $ grep '#define' config.h.in >> > #define HAVE_IFUNC 0 >> > #define HAVE_STRERROR 1 >> > #define HAVE_REGEX 1 >> > #define ARM_PCREL_MOVW_OK 0 >> > #define HAVE_PT_CHOWN 0 >> > #define HAVE_BUILTIN_TRAP 0 >> > #define HAVE_PPC_FCFID 0 >> > #define HAVE_PPC_FCTIDZ 0 >> >> Most of these (those defined to 0) are the templates used by AC_DEFINE. > > OK, so what's the preferred way of adding new macros > like HAVE_BUILTIN_EXPECT and HAVE_REGEX? For case like HAVE_BUILTIN_EXPECT there is not much point in using AC_DEFINE. Andreas.
On Mon, Feb 22, 2016 at 02:09:48PM +0100, Andreas Schwab wrote: > Dmitry V. Levin writes: > > On Mon, Feb 22, 2016 at 01:51:02PM +0100, Andreas Schwab wrote: > >> > >> > We certainly do have some macros defined directly in this file: > >> > $ grep '#define' config.h.in > >> > #define HAVE_IFUNC 0 > >> > #define HAVE_STRERROR 1 > >> > #define HAVE_REGEX 1 > >> > #define ARM_PCREL_MOVW_OK 0 > >> > #define HAVE_PT_CHOWN 0 > >> > #define HAVE_BUILTIN_TRAP 0 > >> > #define HAVE_PPC_FCFID 0 > >> > #define HAVE_PPC_FCTIDZ 0 > >> > >> Most of these (those defined to 0) are the templates used by AC_DEFINE. > > > > OK, so what's the preferred way of adding new macros > > like HAVE_BUILTIN_EXPECT and HAVE_REGEX? > > For case like HAVE_BUILTIN_EXPECT there is not much point in using > AC_DEFINE. Is PATCH v2 OK then?
"Dmitry V. Levin" <ldv@altlinux.org> writes:
> Is PATCH v2 OK then?
Yes, it is ok.
Andreas.
diff --git a/config.h.in b/config.h.in index ec9c8bc..13c0044 100644 --- a/config.h.in +++ b/config.h.in @@ -37,6 +37,11 @@ /* Define if static NSS modules are wanted. */ #undef DO_STATIC_NSS +/* Assume that the compiler supports __builtin_expect. + This macro is necessary for proper compilation of code + shared between GNU libc and GNU gettext projects. */ +#define HAVE_BUILTIN_EXPECT 1 + /* Define if the compiler supports __builtin_memset. */ #undef HAVE_BUILTIN_MEMSET