This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 64bit cleanups for ggc-*.c
- To: lucier at math dot purdue dot edu
- Subject: Re: 64bit cleanups for ggc-*.c
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Sat, 30 Oct 1999 14:33:58 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <199910291817.NAA15430@polya.math.purdue.edu>
I committed the following patch, taking a slightly different approach.
Let me know if you're still experiencing problems.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
Sat Oct 30 14:28:52 1999 Mark Mitchell <mark@codesourcery.com>
* ggc-common.c (ggc_print_statistics): Make arguments to fprintf
match format string, even on 64-bit hosts.
* gcc-page.c (ggc_page_print_statistics): Likewise.
Index: ggc-page.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ggc-page.c,v
retrieving revision 1.13
diff -c -p -r1.13 ggc-page.c
*** ggc-page.c 1999/10/29 04:17:32 1.13
--- ggc-page.c 1999/10/30 15:06:52
*************** ggc_page_print_statistics ()
*** 1146,1155 ****
in_use +=
(OBJECTS_PER_PAGE (i) - p->num_free_objects) * (1 << i);
}
! fprintf (stderr, "%-3d %-15u %-15u\n", i, allocated, in_use);
}
/* Print out some global information. */
! fprintf (stderr, "\nTotal bytes marked: %u\n", G.allocated);
! fprintf (stderr, "Total bytes mapped: %u\n", G.bytes_mapped);
}
--- 1146,1158 ----
in_use +=
(OBJECTS_PER_PAGE (i) - p->num_free_objects) * (1 << i);
}
! fprintf (stderr, "%-3d %-15lu %-15u\n", i,
! (unsigned long) allocated, in_use);
}
/* Print out some global information. */
! fprintf (stderr, "\nTotal bytes marked: %lu\n",
! (unsigned long) G.allocated);
! fprintf (stderr, "Total bytes mapped: %lu\n",
! (unsigned long) G.bytes_mapped);
}
Index: ggc-common.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ggc-common.c,v
retrieving revision 1.11
diff -c -p -r1.11 ggc-common.c
*** ggc-common.c 1999/10/29 04:17:32 1.11
--- ggc-common.c 1999/10/30 15:06:56
*************** ggc_print_statistics (stream, stats)
*** 524,534 ****
for (code = 0; code < MAX_TREE_CODES; ++code)
if (ggc_stats->num_trees[code])
{
! fprintf (stream, "%s%*s%-15u %-15u %7.3f\n",
tree_code_name[code],
! 22 - strlen (tree_code_name[code]), "",
ggc_stats->num_trees[code],
! ggc_stats->size_trees[code],
(100 * ((double) ggc_stats->size_trees[code])
/ ggc_stats->total_size_trees));
}
--- 524,534 ----
for (code = 0; code < MAX_TREE_CODES; ++code)
if (ggc_stats->num_trees[code])
{
! fprintf (stream, "%s%*s%-15u %-15lu %7.3f\n",
tree_code_name[code],
! 22 - (int) strlen (tree_code_name[code]), "",
ggc_stats->num_trees[code],
! (unsigned long) ggc_stats->size_trees[code],
(100 * ((double) ggc_stats->size_trees[code])
/ ggc_stats->total_size_trees));
}
*************** ggc_print_statistics (stream, stats)
*** 543,553 ****
for (code = 0; code < NUM_RTX_CODE; ++code)
if (ggc_stats->num_rtxs[code])
{
! fprintf (stream, "%s%*s%-15u %-15u %7.3f\n",
rtx_name[code],
! 22 - strlen (rtx_name[code]), "",
ggc_stats->num_rtxs[code],
! ggc_stats->size_rtxs[code],
(100 * ((double) ggc_stats->size_rtxs[code])
/ ggc_stats->total_size_rtxs));
}
--- 543,553 ----
for (code = 0; code < NUM_RTX_CODE; ++code)
if (ggc_stats->num_rtxs[code])
{
! fprintf (stream, "%s%*s%-15u %-15lu %7.3f\n",
rtx_name[code],
! 22 - (int) strlen (rtx_name[code]), "",
ggc_stats->num_rtxs[code],
! (unsigned long) ggc_stats->size_rtxs[code],
(100 * ((double) ggc_stats->size_rtxs[code])
/ ggc_stats->total_size_rtxs));
}