File: __builtin_expect

package info (click to toggle)
libdispatch 0~svn188-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,448 kB
  • ctags: 1,652
  • sloc: sh: 10,139; ansic: 8,999; makefile: 229; objc: 37; cpp: 14
file content (23 lines) | stat: -rw-r--r-- 892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Description: workaround for Clang __builtin_expect() bug
 An integer overflow in clang causes __builtin_expect() to return
 incorrect values.
 .
 The bug was fixed in r85666 and is detailed here:
 http://www.mail-archive.com/cfe-commits@cs.uiuc.edu/msg16356.html
 .
Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588711
Author: Mark Heily <mark@heily.com>

Index: libdispatch-0~svn188/src/internal.h
===================================================================
--- libdispatch-0~svn188.orig/src/internal.h	2010-07-10 21:16:59.000000000 -0400
+++ libdispatch-0~svn188/src/internal.h	2010-07-10 21:17:43.000000000 -0400
@@ -137,7 +137,7 @@
 #define NSEC_PER_USEC 1000ull
 
 /* I wish we had __builtin_expect_range() */
-#if __GNUC__
+#if 0
 #define fastpath(x)	((typeof(x))__builtin_expect((long)(x), ~0l))
 #define slowpath(x)	((typeof(x))__builtin_expect((long)(x), 0l))
 #else