counts_entry_t *summaried = NULL;
unsigned seen_summary = 0;
gcov_unsigned_t tag;
- int error = 0;
+ int is_error = 0;
if (!gcov_open (da_file_name, 1))
return;
entry->summary.num = n_counts;
entry->counts = xcalloc (n_counts, sizeof (gcov_type));
}
- else if (entry->checksum != checksum
- || entry->summary.num != n_counts)
+ else if (entry->checksum != checksum)
{
- warning ("coverage mismatch for function %u", fn_ident);
+ error ("coverage mismatch for function %u while reading execution counters.",
+ fn_ident);
+ error ("checksum is %x instead of %x", entry->checksum, checksum);
+ htab_delete (counts_hash);
+ break;
+ }
+ else if (entry->summary.num != n_counts)
+ {
+ error ("coverage mismatch for function %u while reading execution counters.",
+ fn_ident);
+ error ("number of counters is %d instead of %d", entry->summary.num, n_counts);
htab_delete (counts_hash);
break;
}
else if (elt.ctr >= GCOV_COUNTERS_SUMMABLE)
{
- warning ("cannot merge separate %s counters for function %u",
- ctr_names[elt.ctr], fn_ident);
+ error ("cannot merge separate %s counters for function %u",
+ ctr_names[elt.ctr], fn_ident);
goto skip_merge;
}
skip_merge:;
}
gcov_sync (offset, length);
- if ((error = gcov_is_error ()))
+ if ((is_error = gcov_is_error ()))
break;
}
if (!gcov_is_eof ())
{
- warning (error < 0 ? "`%s' has overflowed" : "`%s' is corrupted",
- da_file_name);
+ error (is_error < 0 ? "`%s' has overflowed" : "`%s' is corrupted",
+ da_file_name);
htab_delete (counts_hash);
}
const struct gcov_ctr_summary **summary)
{
counts_entry_t *entry, elt;
+ gcov_unsigned_t checksum = -1;
/* No hash table, no counts. */
if (!counts_hash)
static int warned = 0;
if (!warned++)
- warning ("file %s not found, execution counts assumed to be zero",
- da_file_name);
+ inform ("file %s not found, execution counts assumed to be zero",
+ da_file_name);
return NULL;
}
return 0;
}
- if (expected != entry->summary.num
- || compute_checksum () != entry->checksum)
+ checksum = compute_checksum ();
+ if (entry->checksum != checksum)
{
- warning ("coverage mismatch for `%s'", IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (current_function_decl)));
- return NULL;
+ error ("coverage mismatch for function '%s' while reading counter '%s'.",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),
+ ctr_names[counter]);
+ error ("checksum is %x instead of %x", entry->checksum, checksum);
+ return 0;
+ }
+ else if (entry->summary.num != expected)
+ {
+ error ("coverage mismatch for function '%s' while reading counter '%s'.",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),
+ ctr_names[counter]);
+ error ("number of counters is %d instead of %d", entry->summary.num, expected);
+ return 0;
}
if (summary)
array_type = build_array_type (TREE_TYPE (TREE_TYPE (fields)),
array_type);
- array = build (VAR_DECL, array_type, NULL_TREE, NULL_TREE);
+ array = build_decl (VAR_DECL, NULL_TREE, array_type);
TREE_STATIC (array) = 1;
DECL_NAME (array) = get_identifier (XSTR (ctr_labels[counter], 0));
assemble_variable (array, 0, 0, 0);
gcov_info_value = build_gcov_info ();
- gcov_info = build (VAR_DECL, TREE_TYPE (gcov_info_value),
- NULL_TREE, NULL_TREE);
+ gcov_info = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (gcov_info_value));
DECL_INITIAL (gcov_info) = gcov_info_value;
TREE_STATIC (gcov_info) = 1;