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