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