From: Uros Bizjak Date: Fri, 28 Aug 2009 17:22:01 +0000 (+0200) Subject: global.c (global_alloc): Do not calculate bitmatrix percentages when num_bytes == 0. X-Git-Tag: releases/gcc-4.3.5~408 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78043461743a36ae287a8b61e1acb7c9d8cb0c10;p=thirdparty%2Fgcc.git global.c (global_alloc): Do not calculate bitmatrix percentages when num_bytes == 0. * global.c (global_alloc): Do not calculate bitmatrix percentages when num_bytes == 0. From-SVN: r151170 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 642029039ff2..4e00ce5fa2a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-08-28 Uros Bizjak + + * global.c (global_alloc): Do not calculate bitmatrix percentages + when num_bytes == 0. + 2009-08-28 Uros Bizjak Backport from mainline: diff --git a/gcc/global.c b/gcc/global.c index 12641a60cba5..1cea8502fb2a 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -458,15 +458,23 @@ global_alloc (void) num_bytes = CEIL (num_bits, 8); fprintf (dump_file, "## Standard triangular bitmatrix size: "); fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC " bits, ", num_bits); - fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC " bytes [%.2f%%]\n", - num_bytes, 100.0 * ((double) actual_bytes / (double) num_bytes)); + fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC " bytes ", num_bytes); + if (num_bytes > 0) + fprintf (dump_file, "[%.2f%%]\n", + 100.0 * ((double) actual_bytes / (double) num_bytes)); + else + fprintf (dump_file, "[--%%]\n"); num_bits = (HOST_WIDE_INT) max_allocno * (HOST_WIDE_INT) max_allocno; num_bytes = CEIL (num_bits, 8); fprintf (dump_file, "## Square bitmatrix size: "); fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC " bits, ", num_bits); - fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC " bytes [%.2f%%]\n", - num_bytes, 100.0 * ((double) actual_bytes / (double) num_bytes)); + fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC " bytes ", num_bytes); + if (num_bytes > 0) + fprintf (dump_file, "[%.2f%%]\n", + 100.0 * ((double) actual_bytes / (double) num_bytes)); + else + fprintf (dump_file, "[--%%]\n"); } /* Calculate amount of usage of each hard reg by pseudos