f6cbdf
--- valgrind-3.8.1/cachegrind/cg_sim.c.jj	2011-10-26 23:24:32.000000000 +0200
f6cbdf
+++ valgrind-3.8.1/cachegrind/cg_sim.c	2011-12-09 17:31:19.256023683 +0100
f6cbdf
@@ -42,27 +42,30 @@ typedef struct {
f6cbdf
    Int          size;                   /* bytes */
f6cbdf
    Int          assoc;
f6cbdf
    Int          line_size;              /* bytes */
f6cbdf
-   Int          sets;
f6cbdf
    Int          sets_min_1;
f6cbdf
    Int          line_size_bits;
f6cbdf
    Int          tag_shift;
f6cbdf
-   HChar        desc_line[128];         /* large enough */
f6cbdf
    UWord*       tags;
f6cbdf
-} cache_t2;
f6cbdf
+   HChar        desc_line[128];
f6cbdf
+} cache_t2
f6cbdf
+#ifdef __GNUC__
f6cbdf
+__attribute__ ((aligned (8 * sizeof (Int))))
f6cbdf
+#endif
f6cbdf
+;
f6cbdf
 
f6cbdf
 /* By this point, the size/assoc/line_size has been checked. */
f6cbdf
 static void cachesim_initcache(cache_t config, cache_t2* c)
f6cbdf
 {
f6cbdf
-   Int i;
f6cbdf
+   Int sets;
f6cbdf
 
f6cbdf
    c->size      = config.size;
f6cbdf
    c->assoc     = config.assoc;
f6cbdf
    c->line_size = config.line_size;
f6cbdf
 
f6cbdf
-   c->sets           = (c->size / c->line_size) / c->assoc;
f6cbdf
-   c->sets_min_1     = c->sets - 1;
f6cbdf
+   sets              = (c->size / c->line_size) / c->assoc;
f6cbdf
+   c->sets_min_1     = sets - 1;
f6cbdf
    c->line_size_bits = VG_(log2)(c->line_size);
f6cbdf
-   c->tag_shift      = c->line_size_bits + VG_(log2)(c->sets);
f6cbdf
+   c->tag_shift      = c->line_size_bits + VG_(log2)(sets);
f6cbdf
 
f6cbdf
    if (c->assoc == 1) {
f6cbdf
       VG_(sprintf)(c->desc_line, "%d B, %d B, direct-mapped", 
f6cbdf
@@ -72,11 +75,8 @@ static void cachesim_initcache(cache_t c
f6cbdf
                                  c->size, c->line_size, c->assoc);
f6cbdf
    }
f6cbdf
 
f6cbdf
-   c->tags = VG_(malloc)("cg.sim.ci.1",
f6cbdf
-                         sizeof(UWord) * c->sets * c->assoc);
f6cbdf
-
f6cbdf
-   for (i = 0; i < c->sets * c->assoc; i++)
f6cbdf
-      c->tags[i] = 0;
f6cbdf
+   c->tags = VG_(calloc)("cg.sim.ci.1",
f6cbdf
+                         sizeof(UWord), sets * c->assoc);
f6cbdf
 }
f6cbdf
 
f6cbdf
 /* This attribute forces GCC to inline the function, getting rid of a