OSDN Git Service

2009-05-16 Brad Lucier <lucier@math.purdue.edu>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 May 2009 22:42:15 +0000 (22:42 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 16 May 2009 22:42:15 +0000 (22:42 +0000)
PR middle-end/39301
* hwint.h: Add macro HOST_WIDEST_INT_PRINT.
* bitmap.c (bitmap_descriptor): Make fields HOST_WIDEST_INT.
(output_info): Make field HOST_WIDEST_INT.
(print_statistics): Use HOST_WIDEST_INT_PRINT.
(dump_bitmat_statistics): Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147624 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/bitmap.c
gcc/hwint.h

index 76412d4..0d7b1ac 100644 (file)
@@ -1,3 +1,12 @@
+2009-05-16  Brad Lucier  <lucier@math.purdue.edu>
+
+       PR middle-end/39301
+       * hwint.h: Add macro HOST_WIDEST_INT_PRINT.
+       * bitmap.c (bitmap_descriptor): Make fields HOST_WIDEST_INT.
+       (output_info): Make field HOST_WIDEST_INT.
+       (print_statistics): Use HOST_WIDEST_INT_PRINT.
+       (dump_bitmat_statistics): Same.
+
 2009-05-16  Francois-Xavier Coudert  <fxcoudert@gmail.com>
 
        * config.gcc (use_gcc_stdint):  Set to wrap.
index c9a226a..8e0a724 100644 (file)
@@ -37,10 +37,10 @@ struct bitmap_descriptor
   const char *function;
   const char *file;
   int line;
-  int allocated;
   int created;
-  int peak;
-  int current;
+  HOST_WIDEST_INT allocated;
+  HOST_WIDEST_INT peak;
+  HOST_WIDEST_INT current;
   int nsearches;
 };
 
@@ -2013,8 +2013,8 @@ bitmap_print (FILE *file, const_bitmap head, const char *prefix, const char *suf
 /* Used to accumulate statistics about bitmap sizes.  */
 struct output_info
 {
+  HOST_WIDEST_INT size;
   int count;
-  int size;
 };
 
 /* Called via htab_traverse.  Output bitmap descriptor pointed out by SLOT
@@ -2034,8 +2034,9 @@ print_statistics (void **slot, void *b)
        s1 = s2 + 4;
       sprintf (s, "%s:%i (%s)", s1, d->line, d->function);
       s[41] = 0;
-      fprintf (stderr, "%-41s %6d %10d %10d %10d %10d\n", s,
-              d->created, d->allocated, d->peak, d->current, d->nsearches);
+      fprintf (stderr, "%-41s %8d %15"HOST_WIDEST_INT_PRINT"d %15"
+              HOST_WIDEST_INT_PRINT"d %15"HOST_WIDEST_INT_PRINT"d %10d\n",
+              s, d->created, d->allocated, d->peak, d->current, d->nsearches);
       i->size += d->allocated;
       i->count += d->created;
     }
@@ -2053,14 +2054,14 @@ dump_bitmap_statistics (void)
     return;
 
   fprintf (stderr, "\nBitmap                                     Overall "
-                  "Allocated     Peak        Leak   searched "
+                  "   Allocated        Peak           Leak   searched "
                   "  per search\n");
   fprintf (stderr, "---------------------------------------------------------------------------------\n");
   info.count = 0;
   info.size = 0;
   htab_traverse (bitmap_desc_hash, print_statistics, &info);
   fprintf (stderr, "---------------------------------------------------------------------------------\n");
-  fprintf (stderr, "%-40s %7d %10d\n",
+  fprintf (stderr, "%-40s %9d %15"HOST_WIDEST_INT_PRINT"d\n",
           "Total", info.count, info.size);
   fprintf (stderr, "---------------------------------------------------------------------------------\n");
 #endif
index 4e0679c..1808515 100644 (file)
@@ -99,6 +99,7 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
     || (HOST_BITS_PER_LONGLONG < 64 && HOST_BITS_PER___INT64 < 64)
 # define HOST_WIDEST_INT                     HOST_WIDE_INT
 # define HOST_BITS_PER_WIDEST_INT            HOST_BITS_PER_WIDE_INT
+# define HOST_WIDEST_INT_PRINT                HOST_WIDE_INT_PRINT
 # define HOST_WIDEST_INT_PRINT_DEC           HOST_WIDE_INT_PRINT_DEC
 # define HOST_WIDEST_INT_PRINT_DEC_C         HOST_WIDE_INT_PRINT_DEC_C
 # define HOST_WIDEST_INT_PRINT_UNSIGNED              HOST_WIDE_INT_PRINT_UNSIGNED
@@ -116,6 +117,7 @@ extern char sizeof_long_long_must_be_8[sizeof(long long) == 8 ? 1 : -1];
     #error "This line should be impossible to reach"
 #  endif
 # endif
+# define HOST_WIDEST_INT_PRINT                HOST_LONG_LONG_FORMAT
 # define HOST_WIDEST_INT_PRINT_DEC           "%" HOST_LONG_LONG_FORMAT "d"
 # define HOST_WIDEST_INT_PRINT_DEC_C         "%" HOST_LONG_LONG_FORMAT "dLL"
 # define HOST_WIDEST_INT_PRINT_UNSIGNED              "%" HOST_LONG_LONG_FORMAT "u"