Index: trunk/src/kmk/strcache2.c
===================================================================
--- trunk/src/kmk/strcache2.c	(revision 1903)
+++ trunk/src/kmk/strcache2.c	(revision 1904)
@@ -277,73 +277,74 @@
 strcache2_memcmp_inline_short (const char *xs, const char *ys, unsigned int length)
 {
-  /* short string compare - ~50% of the kBuild calls. */
-  assert ( !((size_t)ys & 3) );
-  if (!((size_t)xs & 3))
-    {
-      /* aligned */
-      int result;
-      switch (length)
-        {
-          case 8:
-              result  = *(int32_t*)(xs + 4) - *(int32_t*)(ys + 4);
-              result |= *(int32_t*)xs - *(int32_t*)ys;
-              return result;
-          case 7:
-              result  = xs[6] - ys[6];
-              result |= xs[5] - ys[5];
-              result |= xs[4] - ys[4];
-              result |= *(int32_t*)xs - *(int32_t*)ys;
-              return result;
-          case 6:
-              result  = xs[5] - ys[5];
-              result |= xs[4] - ys[4];
-              result |= *(int32_t*)xs - *(int32_t*)ys;
-              return result;
-          case 5:
-              result  = xs[4] - ys[4];
-              result |= *(int32_t*)xs - *(int32_t*)ys;
-              return result;
-          case 4:
-              return *(int32_t*)xs - *(int32_t*)ys;
-          case 3:
-              result  = xs[2] - ys[2];
-              result |= xs[1] - ys[1];
-              result |= xs[0] - ys[0];
-              return result;
-          case 2:
-              result  = xs[1] - ys[1];
-              result |= xs[0] - ys[0];
-              return result;
-          case 1:
-              return *xs - *ys;
-          case 0:
-              return 0;
-        }
-    }
-  else
-    {
-      /* unaligned */
-      int result = 0;
-      switch (length)
-        {
-          case 8: result |= xs[7] - ys[7];
-          case 7: result |= xs[6] - ys[6];
-          case 6: result |= xs[5] - ys[5];
-          case 5: result |= xs[4] - ys[4];
-          case 4: result |= xs[3] - ys[3];
-          case 3: result |= xs[2] - ys[2];
-          case 2: result |= xs[1] - ys[1];
-          case 1: result |= xs[0] - ys[0];
-          case 0:
-              return result;
+  if (length <= 8)
+    {
+      /* short string compare - ~50% of the kBuild calls. */
+      assert ( !((size_t)ys & 3) );
+      if (!((size_t)xs & 3))
+        {
+          /* aligned */
+          int result;
+          switch (length)
+            {
+              default: /* memcmp for longer strings */
+                  return memcmp (xs, ys, length);
+              case 8:
+                  result  = *(int32_t*)(xs + 4) - *(int32_t*)(ys + 4);
+                  result |= *(int32_t*)xs - *(int32_t*)ys;
+                  return result;
+              case 7:
+                  result  = xs[6] - ys[6];
+                  result |= xs[5] - ys[5];
+                  result |= xs[4] - ys[4];
+                  result |= *(int32_t*)xs - *(int32_t*)ys;
+                  return result;
+              case 6:
+                  result  = xs[5] - ys[5];
+                  result |= xs[4] - ys[4];
+                  result |= *(int32_t*)xs - *(int32_t*)ys;
+                  return result;
+              case 5:
+                  result  = xs[4] - ys[4];
+                  result |= *(int32_t*)xs - *(int32_t*)ys;
+                  return result;
+              case 4:
+                  return *(int32_t*)xs - *(int32_t*)ys;
+              case 3:
+                  result  = xs[2] - ys[2];
+                  result |= xs[1] - ys[1];
+                  result |= xs[0] - ys[0];
+                  return result;
+              case 2:
+                  result  = xs[1] - ys[1];
+                  result |= xs[0] - ys[0];
+                  return result;
+              case 1:
+                  return *xs - *ys;
+              case 0:
+                  return 0;
+            }
+        }
+      else
+        {
+          /* unaligned */
+          int result = 0;
+          switch (length)
+            {
+              case 8: result |= xs[7] - ys[7];
+              case 7: result |= xs[6] - ys[6];
+              case 6: result |= xs[5] - ys[5];
+              case 5: result |= xs[4] - ys[4];
+              case 4: result |= xs[3] - ys[3];
+              case 3: result |= xs[2] - ys[2];
+              case 2: result |= xs[1] - ys[1];
+              case 1: result |= xs[0] - ys[0];
+              case 0:
+                  return result;
+            }
         }
     }
 
   /* memcmp for longer strings */
-# ifdef __GNUC__
-  return __builtin_memcmp (xs, ys, length);
-# else
   return memcmp (xs, ys, length);
-# endif
 }
 
@@ -466,10 +467,10 @@
       return 0;
 
-#if 1
+#if 0
   return memcmp (entry + 1, str, length) == 0;
-#elif 0
-  return strcache2_memcmp_inlined (entry + 1, str, length) == 0;
+#elif 1
+  return strcache2_memcmp_inlined ((const char *)(entry + 1), str, length) == 0;
 #else
-  return strcache2_memcmp_inline_short (entry + 1, str, length) == 0;
+  return strcache2_memcmp_inline_short ((const char *)(entry + 1), str, length) == 0;
 #endif
 }
