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

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