|
From: <sv...@va...> - 2008-06-10 06:32:53
|
Author: bart
Date: 2008-06-10 07:32:49 +0100 (Tue, 10 Jun 2008)
New Revision: 8212
Log:
Only enable the cache rotation optimization for gcc 4.2 and later.
Modified:
trunk/exp-drd/drd_bitmap.h
Modified: trunk/exp-drd/drd_bitmap.h
===================================================================
--- trunk/exp-drd/drd_bitmap.h 2008-06-09 19:52:37 UTC (rev 8211)
+++ trunk/exp-drd/drd_bitmap.h 2008-06-10 06:32:49 UTC (rev 8212)
@@ -204,12 +204,19 @@
/** Rotate elements cache[0..n-1] such that the element at position n-1 is
* moved to position 0. This allows to speed up future cache lookups.
+ *
+ * @note Apparently gcc 4.2 compiles this code correctly, but gcc 4.1 not.
*/
static __inline__
void bm_cache_rotate(struct bm_cache_elem cache[], const int n)
{
+#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 2
struct bm_cache_elem t;
+#if 0
+ tl_assert(2 <= n && n <= 8);
+#endif
+
t = cache[0];
if (n > 1)
cache[0] = cache[1];
@@ -226,6 +233,7 @@
if (n > 7)
cache[6] = cache[7];
cache[n - 1] = t;
+#endif
}
static __inline__
|