Commit 23190837 by Andreas Jaeger

gcov.c (output_data): Use HOST_WIDEST_INT_PRINT_DEC to output variables of type HOST_WIDEST_INT.

	* gcov.c (output_data): Use HOST_WIDEST_INT_PRINT_DEC to output
	variables of type HOST_WIDEST_INT.

	* libgcc2.c (__bb_exit_func): Handle gcov_type as long long.
	(__bb_exit_func): Correct type of count_max to avoid overflow.
	(num_digits): Handle long long argument.

	* combine.c (gen_lowpart_for_combine): Remove unused variable.

From-SVN: r44033
parent cc385017
2001-07-16 Andreas Jaeger <aj@suse.de>
* gcov.c (output_data): Use HOST_WIDEST_INT_PRINT_DEC to output
variables of type HOST_WIDEST_INT.
* libgcc2.c (__bb_exit_func): Handle gcov_type as long long.
(__bb_exit_func): Correct type of count_max to avoid overflow.
(num_digits): Handle long long argument.
* combine.c (gen_lowpart_for_combine): Remove unused variable.
2001-07-16 Neil Booth <neil@cat.daikokuya.demon.co.uk>
* output.h (sdb_begin_function_line): Restore as an extern
......
......@@ -9717,7 +9717,6 @@ gen_lowpart_for_combine (mode, x)
if (GET_CODE (x) == MEM)
{
register int offset = 0;
rtx new;
/* Refuse to work on a volatile memory ref or one with a mode-dependent
address. */
......
/* Gcov.c: prepend line execution counts and branch probabilities to a
source file.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
1999, 2000 Free Software Foundation, Inc.
1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by James E. Wilson of Cygnus Support.
Mangled by Bob Manson of Cygnus Support.
......@@ -1361,11 +1361,13 @@ output_data ()
{
if (output_branch_counts)
fnotice (gcov_file,
"call %d returns = %d\n",
"call %d returns = "
HOST_WIDEST_INT_PRINT_DEC "\n",
i, a_ptr->total - a_ptr->hits);
else
fnotice (gcov_file,
"call %d returns = %d%%\n",
"call %d returns = "
HOST_WIDEST_INT_PRINT_DEC "%%\n",
i, 100 - ((a_ptr->hits * 100) +
(a_ptr->total >> 1))/a_ptr->total);
}
......@@ -1379,11 +1381,13 @@ output_data ()
{
if (output_branch_counts)
fnotice (gcov_file,
"branch %d taken = %d\n",
"branch %d taken = "
HOST_WIDEST_INT_PRINT_DEC "\n",
i, a_ptr->hits);
else
fnotice (gcov_file,
"branch %d taken = %d%%\n", i,
"branch %d taken = "
HOST_WIDEST_INT_PRINT_DEC "%%\n", i,
((a_ptr->hits * 100) +
(a_ptr->total >> 1))/
a_ptr->total);
......
......@@ -1311,13 +1311,13 @@ char *ctime PARAMS ((const time_t *));
static struct bb *bb_head;
static int num_digits (long value, int base) __attribute__ ((const));
static int num_digits (long long value, int base) __attribute__ ((const));
/* Return the number of digits needed to print a value */
/* __inline__ */ static int num_digits (long value, int base)
/* __inline__ */ static int num_digits (long long value, int base)
{
int minus = (value < 0 && base != 16);
unsigned long v = (minus) ? -value : value;
unsigned long long v = (minus) ? -value : value;
int ret = minus;
do
......@@ -1512,7 +1512,7 @@ __bb_exit_func (void)
int file_p = (func_p && ptr->filenames);
int addr_p = (ptr->addresses != 0);
long ncounts = ptr->ncounts;
long cnt_max = 0;
gcov_type cnt_max = 0;
long line_max = 0;
long addr_max = 0;
int file_len = 0;
......@@ -1564,10 +1564,17 @@ __bb_exit_func (void)
/* Now print out the basic block information. */
for (i = 0; i < ncounts; i++)
{
#if LONG_TYPE_SIZE == GCOV_TYPE_SIZE
fprintf (file,
" Block #%*d: executed %*ld time(s)",
blk_len, i+1,
cnt_len, ptr->counts[i]);
#else
fprintf (file,
" Block #%*d: executed %*lld time(s)",
blk_len, i+1,
cnt_len, ptr->counts[i]);
#endif
if (addr_p)
fprintf (file, " address= 0x%.*lx", addr_len,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment