public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Kalle Olavi Niemitalo <kon@iki.fi>,
	libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH] __builtin_expect cleanup for iconvdata/*.c
Date: Mon, 08 Sep 2014 23:14:00 -0000	[thread overview]
Message-ID: <540E3838.4060504@redhat.com> (raw)
In-Reply-To: <87sik14ydx.fsf@Niukka.kon.iki.fi>

On 09/08/2014 11:04 PM, Kalle Olavi Niemitalo wrote:
> Florian Weimer <fweimer@redhat.com> writes:
>
>> --- a/iconvdata/iso-2022-cn.c
>> +++ b/iconvdata/iso-2022-cn.c
>> @@ -126,22 +126,22 @@ enum
>>         STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
>>   									      \
>>       /* Recognize escape sequences.  */					      \
>> -    if (__builtin_expect (ch, 0) == ESC)				      \
>> +    if (__glibc_unlikely (ch) == ESC)					      \
>
> Shouldn't that be __glibc_unlikely (ch == ESC)?
> I guess it makes no difference in practice, but it looks wrong.
> There are other changes like that, for example:
>
> -	if (__builtin_expect (found, 1) != __UNKNOWN_10646_CHAR)	      \
> +	if (__glibc_likely (found) != __UNKNOWN_10646_CHAR)		      \

Right, these changes are technically correct (they are un-expanding the 
macro definitions), but they are even uglier than the original code. 
I'll work on a regenerated patch with additional heuristics to cover this.

-- 
Florian Weimer / Red Hat Product Security

  reply	other threads:[~2014-09-08 23:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-08 19:42 Florian Weimer
2014-09-08 19:48 ` Andreas Schwab
2014-09-08 20:07 ` Kalle Olavi Niemitalo
2014-09-08 20:43   ` Florian Weimer
2014-09-08 21:00 ` Kalle Olavi Niemitalo
2014-09-08 23:14   ` Florian Weimer [this message]
2014-09-09  2:25 ` Siddhesh Poyarekar
2014-09-09 19:08 ` [PATCH v2] __builtin_expect cleanup for iconv{,data}/*.c (was: Re: [PATCH] __builtin_expect cleanup for iconvdata/*.c) Florian Weimer
2014-09-09 23:51   ` [PATCH v2] __builtin_expect cleanup for iconv{,data}/*.c Kalle Olavi Niemitalo
2014-09-10  7:46     ` Florian Weimer
2014-09-10 17:48       ` Kalle Olavi Niemitalo
2014-09-10 18:07         ` Roland McGrath
2014-09-12  1:46           ` Carlos O'Donell
2014-09-12 17:52             ` Roland McGrath
2014-09-12 18:18               ` Carlos O'Donell
2014-09-23 11:25               ` Florian Weimer
2014-09-09 21:49 ` [PATCH] __builtin_expect cleanup for iconvdata/*.c Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=540E3838.4060504@redhat.com \
    --to=fweimer@redhat.com \
    --cc=kon@iki.fi \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).