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

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