git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8212
/** 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];
if (n > 7)
cache[6] = cache[7];
cache[n - 1] = t;
+#endif
}
static __inline__