Blame SOURCES/valgrind-3.9.0-cachegrind-improvements.patch

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