<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - add optimisation helpers"
href="https://bugs.freedesktop.org/show_bug.cgi?id=39631#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - add optimisation helpers"
href="https://bugs.freedesktop.org/show_bug.cgi?id=39631">bug 39631</a>
from <span class="vcard"><a class="email" href="mailto:sbergman@redhat.com" title="Stephan Bergmann <sbergman@redhat.com>"> <span class="fn">Stephan Bergmann</span></a>
</span></b>
<pre>also note that GCC __builtin_expect (with its first parameter being of type
long) is plain, simple, and generally does not work as one would naively hope:
<span class="quote">> class C {
> private:
> struct S;
> typedef void (S::* B)();
> public:
> operator B();
> };
> int f(C c) {
> if (c) {
> if (__builtin_expect(c, 1)) {
> return 1;
> } else {
> return 2;
> }
> } else {
> return 3;
> }
> }</span >
will cause a compilation error "cannot convert ‘C’ to ‘long int’ for argument
‘1’ to ‘long int __builtin_expect(long int, long int)’"</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>