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
......@@ -271,16 +282,16 @@ Fri Jul 13 23:04:00 2001 Denis Chertykov <denisc@overta.ru>
2001-07-13 Hartmut Penner <hpenner@de.ibm.com>
* config.gcc: Add configuration for s/390.
* config/s390/s390.c: New. Subroutines for code generation.
* config.gcc: Add configuration for s/390.
* config/s390/s390.c: New. Subroutines for code generation.
* config/s390/s390.h: New. Definitions for s/390.
* config/s390/s390-protos.h: New. Prototypes.
* config/s390/linux.h: New. Definitions for linux for s/390.
* config/s390/linux64.h: New. Definitions for linux for zSeries.
* config/s390/t-linux: New. Makefile fragment.
* config/s390/s390.md: New. Machine description for s/390 and zSeries.
* config/s390/t-linux: New. Makefile fragment.
* config/s390/s390.md: New. Machine description for s/390 and zSeries.
* config/s390/fixdfdi.h: New. Fix L_fix*di.
Fri Jul 13 14:46:21 CEST 2001 Jan Hubicka <jh@suse.cz>
* emit-rtl.c (try_split): Update mark_jump_label call.
......@@ -475,7 +486,7 @@ Wed Jul 11 21:27:25 CEST 2001 Jan Hubicka <jh@suse.cz>
* jump.c (rtx_renumbered_equal_p): Handle 't' fields.
* output.h (cleanup_cfg): Update prototype.
* reg-stack.c (reg_to_stack): Use cleanup_cfg instead of jump_optimize
* sibcall.c (optimize_sibling_and_tail_recursive_call): Update
* sibcall.c (optimize_sibling_and_tail_recursive_call): Update
cleanup_cfg call; kill missleading comment.
* toplev.c (rest_of_compilation): Update all cleanup_cfg calls.
* flow.c (merge_blocks, try_optimize_cfg, cleanup_cfg): Accept mode
......@@ -506,7 +517,7 @@ Wed Jul 11 21:27:25 CEST 2001 Jan Hubicka <jh@suse.cz>
2001-07-11 Mark Mitchell <mark@codesourcery.com>
* stmt.c (parse_output_constraint): New function, split out
* stmt.c (parse_output_constraint): New function, split out
from ...
(expand_asm_operands): ... here. Use parse_output_constraint.
* tree.h (parse_output_constraint): Declare it.
......@@ -573,7 +584,7 @@ Tue Jul 10 07:27:53 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* recog.c (offsettable_address_p): Handle LO_SUM case.
* config/mips/mips.c (double_memory_operand): Use adjust_address_nv
instead of plus_constant.
2001-07-10 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* reload1.c (merge_assigned_reloads): After a RELOAD_OTHER merge,
......@@ -640,7 +651,7 @@ Tue Jul 10 09:04:45 2001 Jeffrey A Law (law@cygnus.com)
.loc support.
* collect2.c (main): Set COLLECT_NO_DEMANGLE for subprocesses.
(dump_file): Only pad the demangled name with spaces if the
(dump_file): Only pad the demangled name with spaces if the
mangled name was padded with spaces.
2001-07-10 Bernd Schmidt <bernds@redhat.com>
......
......@@ -1133,7 +1133,7 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
for (p = NEXT_INSN (insn); p != i3; p = NEXT_INSN (p))
if (INSN_P (p) && p != succ && volatile_refs_p (PATTERN (p)))
return 0;
return 0;
}
/* If INSN is an asm, and DEST is a hard register, reject, since it has
......@@ -1245,7 +1245,7 @@ sets_function_arg_p (pat)
This is NOT equivalent to:
(parallel [(set (subreg:SI (reg:DI 100) 0) <foo>)
(set (reg:DI 101) (reg:DI 100))])
(set (reg:DI 101) (reg:DI 100))])
Not only does this modify 100 (in which case it might still be valid
if 100 were dead in I2), it sets 101 to the ORIGINAL value of 100.
......@@ -1421,7 +1421,7 @@ cant_combine_insn_p (insn)
{
rtx set;
rtx src, dest;
/* If this isn't really an insn, we can't do anything.
This can occur when flow deletes an insn that it has merged into an
auto-increment address. */
......@@ -1771,7 +1771,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
/* If I3 has an inc, then give up if I1 or I2 uses the reg that is inc'd.
We used to do this EXCEPT in one case: I3 has a post-inc in an
output operand. However, that exception can give rise to insns like
mov r3,(r3)+
mov r3,(r3)+
which is a famous insn on the PDP-11 where the value of r3 used as the
source was model-dependent. Avoid this sort of thing. */
......@@ -2136,7 +2136,7 @@ try_combine (i3, i2, i1, new_direct_jump_p)
insn_code_number = recog_for_combine (&m_split, i3, &new_i3_notes);
if (insn_code_number >= 0)
newpat = m_split;
}
}
else if (m_split && GET_CODE (m_split) == SEQUENCE
&& XVECLEN (m_split, 0) == 2
&& (next_real_insn (i2) == i3
......@@ -3786,7 +3786,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
{
rtx temp;
temp = simplify_subreg (mode, SUBREG_REG (x), op0_mode,
SUBREG_BYTE (x));
SUBREG_BYTE (x));
if (temp)
return temp;
}
......@@ -3861,12 +3861,12 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
return gen_rtx_GE (mode, XEXP (XEXP (x, 0), 0), const0_rtx);
/* Apply De Morgan's laws to reduce number of patterns for machines
with negating logical insns (and-not, nand, etc.). If result has
only one NOT, put it first, since that is how the patterns are
coded. */
with negating logical insns (and-not, nand, etc.). If result has
only one NOT, put it first, since that is how the patterns are
coded. */
if (GET_CODE (XEXP (x, 0)) == IOR || GET_CODE (XEXP (x, 0)) == AND)
{
{
rtx in1 = XEXP (XEXP (x, 0), 0), in2 = XEXP (XEXP (x, 0), 1);
enum machine_mode op_mode;
......@@ -3931,7 +3931,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
temp = expand_compound_operation (XEXP (x, 0));
/* For C equal to the width of MODE minus 1, (neg (ashiftrt X C)) can be
replaced by (lshiftrt X C). This will convert
replaced by (lshiftrt X C). This will convert
(neg (sign_extract X 1 Y)) to (zero_extract X 1 Y). */
if (GET_CODE (temp) == ASHIFTRT
......@@ -4015,7 +4015,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
&& num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
>= GET_MODE_BITSIZE (mode) + 1
&& ! (GET_CODE (XEXP (x, 0)) == LSHIFTRT
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT))
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT))
return gen_lowpart_for_combine (mode, XEXP (x, 0));
/* A truncate of a comparison can be replaced with a subreg if
......@@ -4250,8 +4250,8 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
case GT: case GTU: case GE: case GEU:
case LT: case LTU: case LE: case LEU:
case UNEQ: case LTGT:
case UNGT: case UNGE:
case UNLT: case UNLE:
case UNGT: case UNGE:
case UNLT: case UNLE:
case UNORDERED: case ORDERED:
/* If the first operand is a condition code, we can't do anything
with it. */
......@@ -4527,7 +4527,7 @@ combine_simplify_rtx (x, op0_mode, last, in_dest)
}
break;
default:
break;
}
......@@ -5579,7 +5579,7 @@ expand_compound_operation (x)
&& GET_RTX_CLASS (GET_CODE (XEXP (XEXP (x, 0), 0))) == '<'
&& (GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))
<= HOST_BITS_PER_WIDE_INT)
&& ((HOST_WIDE_INT) STORE_FLAG_VALUE
&& ((HOST_WIDE_INT) STORE_FLAG_VALUE
& ~GET_MODE_MASK (GET_MODE (XEXP (x, 0)))) == 0)
return XEXP (XEXP (x, 0), 0);
......@@ -5922,9 +5922,9 @@ make_extraction (mode, inner, pos, pos_rtx, len,
new = gen_rtx_SUBREG (tmode, inner, final_word);
}
else
new = inner;
}
else
new = inner;
}
else
new = force_to_mode (inner, tmode,
len >= HOST_BITS_PER_WIDE_INT
......@@ -7418,7 +7418,7 @@ known_cond (x, cond, reg, val)
/* Do not reverse the condition when it is NE or EQ.
This is because we cannot conclude anything about
the value of 'SMAX (x, y)' when x is not equal to y,
but we can when x equals y. */
but we can when x equals y. */
if ((code == SMAX || code == UMAX)
&& ! (cond == EQ || cond == NE))
cond = reverse_condition (cond);
......@@ -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. */
......@@ -10530,7 +10529,7 @@ simplify_comparison (code, pop0, pop1)
new_code = GET_CODE (op0);
else
new_code = combine_reversed_comparison_code (op0);
if (new_code != UNKNOWN)
{
code = new_code;
......
/* 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.
......@@ -218,7 +218,7 @@ static char *object_directory = 0;
/* Output the number of times a branch was taken as opposed to the percentage
of times it was taken. Turned on by the -c option */
static int output_branch_counts = 0;
/* Forward declarations. */
......@@ -438,7 +438,7 @@ open_files ()
fnotice (stderr, "Could not open data file %s.\n", da_file_name);
fnotice (stderr, "Assuming that all execution counts are zero.\n");
}
bbg_file = fopen (bbg_file_name, "rb");
if (bbg_file == NULL)
{
......@@ -590,7 +590,7 @@ create_program_flow_graph (bptr)
bb_graph[arcptr->target].pred_count--;
}
}
static void
solve_program_flow_graph (bptr)
struct bb_info_list *bptr;
......@@ -707,7 +707,7 @@ solve_program_flow_graph (bptr)
}
}
}
/* If the graph has been correctly solved, every block will have a
succ and pred count of zero. */
for (i = 0; i < num_blocks; i++)
......@@ -772,7 +772,7 @@ read_files ()
bb_data = (char *) xmalloc ((unsigned) buf.st_size);
fread (bb_data, sizeof (char), buf.st_size, bb_file);
fclose (bb_file);
if (da_file)
fclose (da_file);
......@@ -890,7 +890,7 @@ calculate_branch_probs (current_graph, block_num, branch_probs, last_line_num)
if (arcptr->fall_through)
continue;
a_ptr = (struct arcdata *) xmalloc (sizeof (struct arcdata));
a_ptr->total = total;
if (total == 0)
......@@ -1042,7 +1042,7 @@ output_data ()
if (output_branch_probs)
branch_probs = (struct arcdata **)
xcalloc (sizeof (struct arcdata *), s_ptr->maxlineno);
/* There will be a zero at the beginning of the bb info, before the
first list of line numbers, so must initialize block_num to 0. */
block_num = 0;
......@@ -1066,7 +1066,7 @@ output_data ()
this_file = 0;
else
this_file = 1;
/* Scan past the file name. */
do {
count++;
......@@ -1139,7 +1139,7 @@ output_data ()
function_name);
abort ();
}
if (output_branch_probs && this_file)
calculate_branch_probs (current_graph, block_num,
branch_probs, last_line_num);
......@@ -1246,7 +1246,7 @@ output_data ()
/* Now the statistics are ready. Read in the source file one line
at a time, and output that line to the gcov file preceded by
its execution count if non zero. */
source_file = fopen (source_file_name, "r");
if (source_file == NULL)
{
......@@ -1266,7 +1266,7 @@ output_data ()
if (output_long_names && strcmp (cptr, input_file_name))
{
gcov_file_name = xmalloc (count + 7 + strlen (input_file_name));
cptr = strrchr (input_file_name, '/');
if (cptr)
strcpy (gcov_file_name, cptr + 1);
......@@ -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);
......
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