[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] Is there a bug fixed in performance optimisations

From: Lassi Tuura
Subject: Re: [Libunwind-devel] Is there a bug fixed in performance optimisations for fast trace?
Date: Tue, 6 Dec 2011 17:05:47 +0100


> I recently found a confusion in a commit of src/x86_64/Ginit.c.
> URL:
> There is a revision as following:
> -      if (c && c->validate && validate_mem(addr))
> +      if (likely (c != 0) && unlikely (c->validate)
> +          && unlikely (validate_mem (addr)))
> The if logic will have a different result while the c->validate is zero.
> Is there a bug fixed here or I have a misunderstanding.
> I am looking forward to your reply. Thank you!

Could you clarify what you mean by 'different result', or how the
meaning changed to be a bug? likely/unlikely(x) translate into
__builtin_expect((x), 0/1), which is documented to evaluate to 'x'.

I'm a little weary eyed for tonight, but stripping likely/unlikely
seems to translate to the same 'if' condition to me.

At any rate, that particular patch was not supposed to change meaning,
so if there's a bug, could you please submit a patch? If you have an
easy way of replicating that problem that would be nice too.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]