Use HOST_SIZE_T_PRINT_* and HOST_WIDE_INT_T_PRINT_* some more

I went through suspicios %l in format strings of *printf family functions
combined with casts to (long) or (unsigned long) and tried to find out the
types of the original expressions that were cast.
Quite a few had size_t type, so I've used the new HOST_SIZE_T_PRINT_*
macros together with cast to fmt_size_t for those, and then there were
quite a few HOST_WIDE_INTs cast to long, used HOST_WIDE_INT_PRINT_* for
those without casts.  There was one case of a weird unsigned int variable
used with %lu and (long) cast too.

2024-02-10  Jakub Jelinek  <jakub@redhat.com>

gcc/
	* ipa-icf.cc (sem_item_optimizer::process_cong_reduction,
	sem_item_optimizer::dump_cong_classes): Use HOST_SIZE_T_PRINT_UNSIGNED
	and casts to fmt_size_t instead of "%lu" and casts to unsigned long.
	* tree.cc (print_debug_expr_statistics): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.
	(print_value_expr_statistics, print_type_hash_statistics): Likewise.
	* dwarf2out.cc (output_macinfo_op): Use HOST_WIDE_INT_PRINT_UNSIGNED
	instead of "%lu" and casts to unsigned long.
	* gcov-dump.cc (dump_gcov_file): Use %u instead of %lu and casts to
	unsigned long.
	* tree-ssa-dom.cc (htab_statistics): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.
	* cfgexpand.cc (dump_stack_var_partition): Use
	HOST_SIZE_T_PRINT_UNSIGNED and casts to fmt_size_t instead of "%lu"
	and casts to unsigned long.
	* gengtype.cc (adjust_field_rtx_def): Likewise.
	* tree-into-ssa.cc (htab_statistics): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.
	* postreload-gcse.cc (dump_hash_table): Likewise.
	* ggc-page.cc (alloc_page): Use HOST_SIZE_T_PRINT_UNSIGNED
	and casts to fmt_size_t instead of "%lu" and casts to unsigned long.
	(ggc_internal_alloc, ggc_free): Likewise.
	* genpreds.cc (write_lookup_constraint_1): Likewise.
	(write_insn_constraint_len): Likewise.
	* tree-dfa.cc (dump_dfa_stats): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.
	* varasm.cc (output_constant_pool_contents): Use
	HOST_WIDE_INT_PRINT_DEC instead of "%ld" and casts to long.
	* var-tracking.cc (dump_var): Likewise.
gcc/c-family/
	* c-ada-spec.cc (dump_template_types): Use HOST_SIZE_T_PRINT_UNSIGNED
	and casts to fmt_size_t instead of "%lu" and casts to unsigned long.
gcc/c/
	* c-decl.cc (get_parm_array_spec): Use HOST_WIDE_INT_PRINT_UNSIGNED
	instead of "%lu" and casts to unsigned long or unsigned long long.
gcc/cp/
	* tree.cc (debug_binfo): Use HOST_WIDE_INT_PRINT_DEC instead of "%ld"
	and casts to long.
	* pt.cc (print_template_statistics): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.
	* class.cc (dump_class_hierarchy_1): Use HOST_WIDE_INT_PRINT_UNSIGNED
	instead of "%lu" and casts to unsigned long.  For TYPE_ALIGN, use
	%u instead of %lu and drop casts to unsigned long.
	* parser.cc (cp_lexer_peek_nth_token): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.
gcc/fortran/
	* trans-common.cc (build_common_decl): Use %wu instead of %lu and
	casts to unsigned long.
	* resolve.cc (resolve_ordinary_assign): Use %wd instead of %ld and
	casts to long.
	* array.cc (gfc_resolve_character_array_constructor): Likewise.
	* data.cc (create_character_initializer): Likewise.
gcc/jit/
	* jit-playback.cc (new_bitcast): Use HOST_WIDE_INT_PRINT_DEC instead
	of "%ld" and casts to long.
gcc/lto/
	* lto-common.cc (print_lto_report_1): Use HOST_SIZE_T_PRINT_DEC
	and casts to fmt_size_t instead of "%ld" and casts to long.  Use
	%d instead of %ld and casts to long for searches and collisions.
This commit is contained in:
Jakub Jelinek 2024-02-10 11:26:26 +01:00
parent 48207a5f00
commit 89e93ce8b9
26 changed files with 121 additions and 93 deletions

View file

@ -1852,7 +1852,8 @@ dump_template_types (pretty_printer *buffer, tree types, int spc)
if (!dump_ada_node (buffer, elem, NULL_TREE, spc, false, true))
{
pp_string (buffer, "unknown");
pp_scalar (buffer, "%lu", (unsigned long) TREE_HASH (elem));
pp_scalar (buffer, HOST_SIZE_T_PRINT_UNSIGNED,
(fmt_size_t) TREE_HASH (elem));
}
}
}

View file

@ -6236,7 +6236,7 @@ get_parm_array_spec (const struct c_parm *parm, tree attrs)
index. */
HOST_WIDE_INT n = tree_to_shwi (max) + 1;
char buf[40];
sprintf (buf, "%lu", (unsigned long)n);
sprintf (buf, HOST_WIDE_INT_PRINT_UNSIGNED, n);
spec += buf;
}
continue;
@ -6309,7 +6309,7 @@ get_parm_array_spec (const struct c_parm *parm, tree attrs)
char buf[40];
unsigned HOST_WIDE_INT n = tree_to_uhwi (nelts);
sprintf (buf, "%llu", (unsigned long long)n);
sprintf (buf, HOST_WIDE_INT_PRINT_UNSIGNED, n);
spec += buf;
break;
}

View file

@ -1024,7 +1024,8 @@ dump_stack_var_partition (void)
if (stack_vars[i].representative != i)
continue;
fprintf (dump_file, "Partition %lu: size ", (unsigned long) i);
fprintf (dump_file, "Partition " HOST_SIZE_T_PRINT_UNSIGNED ": size ",
(fmt_size_t) i);
print_dec (stack_vars[i].size, dump_file);
fprintf (dump_file, " align %u\n", stack_vars[i].alignb);

View file

@ -9585,14 +9585,14 @@ static void
dump_class_hierarchy_1 (FILE *stream, dump_flags_t flags, tree t)
{
fprintf (stream, "Class %s\n", type_as_string (t, TFF_PLAIN_IDENTIFIER));
fprintf (stream, " size=%lu align=%lu\n",
(unsigned long)(tree_to_shwi (TYPE_SIZE (t)) / BITS_PER_UNIT),
(unsigned long)(TYPE_ALIGN (t) / BITS_PER_UNIT));
fprintf (stream, " size=" HOST_WIDE_INT_PRINT_UNSIGNED " align=%u\n",
tree_to_shwi (TYPE_SIZE (t)) / BITS_PER_UNIT,
TYPE_ALIGN (t) / BITS_PER_UNIT);
if (tree as_base = CLASSTYPE_AS_BASE (t))
fprintf (stream, " base size=%lu base align=%lu\n",
(unsigned long)(tree_to_shwi (TYPE_SIZE (as_base))
/ BITS_PER_UNIT),
(unsigned long)(TYPE_ALIGN (as_base) / BITS_PER_UNIT));
fprintf (stream, " base size=" HOST_WIDE_INT_PRINT_UNSIGNED
" base align=%u\n",
tree_to_shwi (TYPE_SIZE (as_base)) / BITS_PER_UNIT,
TYPE_ALIGN (as_base) / BITS_PER_UNIT);
dump_class_hierarchy_r (stream, flags, TYPE_BINFO (t), TYPE_BINFO (t), 0);
fprintf (stream, "\n");
}

View file

@ -1310,7 +1310,8 @@ cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
if (cp_lexer_debugging_p (lexer))
fprintf (cp_lexer_debug_stream,
"cp_lexer: peeking ahead %ld at token: ", (long)n);
"cp_lexer: peeking ahead " HOST_SIZE_T_PRINT_DEC " at token: ",
(fmt_size_t) n);
--n;
token = lexer->next_token;

View file

@ -31593,13 +31593,15 @@ init_template_processing (void)
void
print_template_statistics (void)
{
fprintf (stderr, "decl_specializations: size %ld, %ld elements, "
"%f collisions\n", (long) decl_specializations->size (),
(long) decl_specializations->elements (),
fprintf (stderr, "decl_specializations: size " HOST_SIZE_T_PRINT_DEC ", "
HOST_SIZE_T_PRINT_DEC " elements, %f collisions\n",
(fmt_size_t) decl_specializations->size (),
(fmt_size_t) decl_specializations->elements (),
decl_specializations->collisions ());
fprintf (stderr, "type_specializations: size %ld, %ld elements, "
"%f collisions\n", (long) type_specializations->size (),
(long) type_specializations->elements (),
fprintf (stderr, "type_specializations: size " HOST_SIZE_T_PRINT_DEC ", "
HOST_SIZE_T_PRINT_DEC " elements, %f collisions\n",
(fmt_size_t) type_specializations->size (),
(fmt_size_t) type_specializations->elements (),
type_specializations->collisions ());
}

View file

@ -2253,9 +2253,10 @@ debug_binfo (tree elem)
while (virtuals)
{
tree fndecl = TREE_VALUE (virtuals);
fprintf (stderr, "%s [%ld =? %ld]\n",
fprintf (stderr, "%s [" HOST_WIDE_INT_PRINT_DEC " =? "
HOST_WIDE_INT_PRINT_DEC "]\n",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)),
(long) n, (long) TREE_INT_CST_LOW (DECL_VINDEX (fndecl)));
n, TREE_INT_CST_LOW (DECL_VINDEX (fndecl)));
++n;
virtuals = TREE_CHAIN (virtuals);
}

View file

@ -28987,8 +28987,9 @@ output_macinfo_op (macinfo_entry *ref)
file_num = maybe_emit_file (fd);
dw2_asm_output_data (1, DW_MACINFO_start_file, "Start new file");
dw2_asm_output_data_uleb128 (ref->lineno,
"Included from line number %lu",
(unsigned long) ref->lineno);
"Included from line number "
HOST_WIDE_INT_PRINT_UNSIGNED,
ref->lineno);
dw2_asm_output_data_uleb128 (file_num, "file %s", ref->info);
break;
case DW_MACINFO_end_file:
@ -29014,8 +29015,10 @@ output_macinfo_op (macinfo_entry *ref)
dw2_asm_output_data (1, ref->code,
ref->code == DW_MACINFO_define
? "Define macro" : "Undefine macro");
dw2_asm_output_data_uleb128 (ref->lineno, "At line number %lu",
(unsigned long) ref->lineno);
dw2_asm_output_data_uleb128 (ref->lineno,
"At line number "
HOST_WIDE_INT_PRINT_UNSIGNED,
ref->lineno);
dw2_asm_output_nstring (ref->info, -1, "The macro");
break;
case DW_MACRO_define_strp:
@ -29047,8 +29050,10 @@ output_macinfo_op (macinfo_entry *ref)
gcc_assert (node
&& (node->form == DW_FORM_strp
|| node->form == dwarf_FORM (DW_FORM_strx)));
dw2_asm_output_data_uleb128 (ref->lineno, "At line number %lu",
(unsigned long) ref->lineno);
dw2_asm_output_data_uleb128 (ref->lineno,
"At line number "
HOST_WIDE_INT_PRINT_UNSIGNED,
ref->lineno);
if (node->form == DW_FORM_strp)
dw2_asm_output_offset (dwarf_offset_size, node->label,
debug_str_section, "The macro: \"%s\"",

View file

@ -2212,9 +2212,9 @@ got_charlen:
found_length = current_length;
else if (found_length != current_length)
{
gfc_error ("Different CHARACTER lengths (%ld/%ld) in array"
" constructor at %L", (long) found_length,
(long) current_length, &p->expr->where);
gfc_error ("Different CHARACTER lengths (%wd/%wd) in array"
" constructor at %L", found_length,
current_length, &p->expr->where);
return false;
}

View file

@ -209,8 +209,8 @@ create_character_initializer (gfc_expr *init, gfc_typespec *ts,
else
{
gfc_warning_now (0, "Initialization string at %L was truncated to "
"fit the variable (%ld/%ld)", &rvalue->where,
(long) tlen, (long) len);
"fit the variable (%wd/%wd)", &rvalue->where,
tlen, len);
len = tlen;
}
}

View file

@ -11291,8 +11291,8 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
if (rlen && llen && rlen > llen)
gfc_warning_now (OPT_Wcharacter_truncation,
"CHARACTER expression will be truncated "
"in assignment (%ld/%ld) at %L",
(long) llen, (long) rlen, &code->loc);
"in assignment (%wd/%wd) at %L",
llen, rlen, &code->loc);
}
/* Ensure that a vector index expression for the lvalue is evaluated

View file

@ -409,10 +409,10 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
if (!tree_int_cst_equal (DECL_SIZE_UNIT (decl), size)
&& strcmp (com->name, BLANK_COMMON_NAME))
gfc_warning (0, "Named COMMON block %qs at %L shall be of the "
"same size as elsewhere (%lu vs %lu bytes)", com->name,
"same size as elsewhere (%wu vs %wu bytes)", com->name,
&com->where,
(unsigned long) TREE_INT_CST_LOW (size),
(unsigned long) TREE_INT_CST_LOW (DECL_SIZE_UNIT (decl)));
TREE_INT_CST_LOW (size),
TREE_INT_CST_LOW (DECL_SIZE_UNIT (decl)));
if (tree_int_cst_lt (DECL_SIZE_UNIT (decl), size))
{

View file

@ -218,11 +218,11 @@ dump_gcov_file (const char *filename)
/* stamp */
unsigned stamp = gcov_read_unsigned ();
printf ("%s:stamp %lu\n", filename, (unsigned long)stamp);
printf ("%s:stamp %u\n", filename, stamp);
/* Checksum */
unsigned checksum = gcov_read_unsigned ();
printf ("%s:checksum %lu\n", filename, (unsigned long)checksum);
printf ("%s:checksum %u\n", filename, checksum);
if (!is_data_type)
{

View file

@ -1294,8 +1294,9 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
{
error_at_line
(&lexer_line,
"rtx type `%s' has `0' in position %lu, can't handle",
rtx_name[i], (unsigned long) aindex);
"rtx type `%s' has `0' in position "
HOST_SIZE_T_PRINT_UNSIGNED ", can't handle",
rtx_name[i], (fmt_size_t) aindex);
t = &string_type;
subname = "rt_int";
}
@ -1333,9 +1334,10 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
default:
error_at_line
(&lexer_line,
"rtx type `%s' has `%c' in position %lu, can't handle",
"rtx type `%s' has `%c' in position "
HOST_SIZE_T_PRINT_UNSIGNED ", can't handle",
rtx_name[i], rtx_format[i][aindex],
(unsigned long) aindex);
(fmt_size_t) aindex);
t = &string_type;
subname = "rt_int";
break;

View file

@ -1095,9 +1095,10 @@ write_lookup_constraint_1 (void)
do
{
if (c->namelen > 2)
printf (" if (!strncmp (str + 1, \"%s\", %lu))\n"
printf (" if (!strncmp (str + 1, \"%s\", "
HOST_SIZE_T_PRINT_UNSIGNED "))\n"
" return CONSTRAINT_%s;\n",
c->name + 1, (unsigned long int) c->namelen - 1,
c->name + 1, (fmt_size_t) (c->namelen - 1),
c->c_name);
else
printf (" if (str[1] == '%c')\n"
@ -1174,8 +1175,8 @@ write_insn_constraint_len (void)
}
}
printf (" case '%c': return %lu;\n",
i, (unsigned long int) c->namelen);
printf (" case '%c': return " HOST_SIZE_T_PRINT_UNSIGNED ";\n",
i, (fmt_size_t) c->namelen);
}
puts (" default: break;\n"

View file

@ -940,8 +940,9 @@ alloc_page (unsigned order)
if (GGC_DEBUG_LEVEL >= 2)
fprintf (G.debug_file,
"Allocating page at %p, object size=%lu, data %p-%p\n",
(void *) entry, (unsigned long) OBJECT_SIZE (order),
"Allocating page at %p, object size="
HOST_SIZE_T_PRINT_UNSIGNED ", data %p-%p\n",
(void *) entry, (fmt_size_t) OBJECT_SIZE (order),
(void *) page, (void *) (page + entry_size - 1));
return entry;
@ -1448,8 +1449,10 @@ ggc_internal_alloc (size_t size, void (*f)(void *), size_t s, size_t n
if (GGC_DEBUG_LEVEL >= 3)
fprintf (G.debug_file,
"Allocating object, requested size=%lu, actual=%lu at %p on %p\n",
(unsigned long) size, (unsigned long) object_size, result,
"Allocating object, requested size="
HOST_SIZE_T_PRINT_UNSIGNED ", actual=" HOST_SIZE_T_PRINT_UNSIGNED
" at %p on %p\n",
(fmt_size_t) size, (fmt_size_t) object_size, result,
(void *) entry);
return result;
@ -1621,8 +1624,9 @@ ggc_free (void *p)
if (GGC_DEBUG_LEVEL >= 3)
fprintf (G.debug_file,
"Freeing object, actual size=%lu, at %p on %p\n",
(unsigned long) size, p, (void *) pe);
"Freeing object, actual size="
HOST_SIZE_T_PRINT_UNSIGNED ", at %p on %p\n",
(fmt_size_t) size, p, (void *) pe);
#ifdef ENABLE_GC_CHECKING
/* Poison the data, to indicate the data is garbage. */

View file

@ -3191,8 +3191,9 @@ sem_item_optimizer::process_cong_reduction (void)
worklist_push ((*it)->classes[i]);
if (dump_file)
fprintf (dump_file, "Worklist has been filled with: %lu\n",
(unsigned long) worklist.nodes ());
fprintf (dump_file, "Worklist has been filled with: "
HOST_SIZE_T_PRINT_UNSIGNED "\n",
(fmt_size_t) worklist.nodes ());
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Congruence class reduction\n");
@ -3239,8 +3240,9 @@ sem_item_optimizer::dump_cong_classes (void)
}
fprintf (dump_file,
"Congruence classes: %lu with total: %u items (in a non-singular "
"class: %u)\n", (unsigned long) m_classes.elements (),
"Congruence classes: " HOST_SIZE_T_PRINT_UNSIGNED " with total: "
"%u items (in a non-singular class: %u)\n",
(fmt_size_t) m_classes.elements (),
m_items.length (), m_items.length () - single_element_classes);
fprintf (dump_file,
"Class size histogram [number of members]: number of classes\n");

View file

@ -1602,11 +1602,11 @@ new_bitcast (location *loc,
{
active_playback_ctxt->add_error (loc,
"bitcast with types of different sizes");
fprintf (stderr, "input expression (size: %ld):\n",
(long) tree_to_uhwi (expr_size));
fprintf (stderr, "input expression (size: " HOST_WIDE_INT_PRINT_DEC "):\n",
tree_to_uhwi (expr_size));
debug_tree (t_expr);
fprintf (stderr, "requested type (size: %ld):\n",
(long) tree_to_uhwi (type_size));
fprintf (stderr, "requested type (size: " HOST_WIDE_INT_PRINT_DEC "):\n",
tree_to_uhwi (type_size));
debug_tree (t_dst_type);
}
tree t_bitcast = build1 (VIEW_CONVERT_EXPR, t_dst_type, t_expr);

View file

@ -3021,10 +3021,10 @@ print_lto_report_1 (void)
total_scc_size + num_unshared_trees_read);
if (flag_wpa && tree_scc_hash && num_sccs_read)
{
fprintf (stderr, "[%s] tree SCC table: size %ld, %ld elements, "
"collision ratio: %f\n", pfx,
(long) tree_scc_hash->size (),
(long) tree_scc_hash->elements (),
fprintf (stderr, "[%s] tree SCC table: size " HOST_SIZE_T_PRINT_DEC ", "
HOST_SIZE_T_PRINT_DEC " elements, collision ratio: %f\n", pfx,
(fmt_size_t) tree_scc_hash->size (),
(fmt_size_t) tree_scc_hash->elements (),
tree_scc_hash->collisions ());
hash_table<tree_scc_hasher>::iterator hiter;
tree_scc *scc, *max_scc = NULL;
@ -3052,12 +3052,13 @@ print_lto_report_1 (void)
fprintf (stderr, "[%s] Merged %lu types\n", pfx, num_merged_types);
fprintf (stderr, "[%s] %lu types prevailed (%lu associated trees)\n",
pfx, num_prevailing_types, num_type_scc_trees);
fprintf (stderr, "[%s] GIMPLE canonical type table: size %ld, "
"%ld elements, %ld searches, %ld collisions (ratio: %f)\n", pfx,
(long) htab_size (gimple_canonical_types),
(long) htab_elements (gimple_canonical_types),
(long) gimple_canonical_types->searches,
(long) gimple_canonical_types->collisions,
fprintf (stderr, "[%s] GIMPLE canonical type table: size "
HOST_SIZE_T_PRINT_DEC ", " HOST_SIZE_T_PRINT_DEC
" elements, %d searches, %d collisions (ratio: %f)\n", pfx,
(fmt_size_t) htab_size (gimple_canonical_types),
(fmt_size_t) htab_elements (gimple_canonical_types),
gimple_canonical_types->searches,
gimple_canonical_types->collisions,
htab_collisions (gimple_canonical_types));
fprintf (stderr, "[%s] GIMPLE canonical type pointer-map: "
"%lu elements, %ld searches\n", pfx,

View file

@ -487,9 +487,10 @@ static void
dump_hash_table (FILE *file)
{
fprintf (file, "\n\nexpression hash table\n");
fprintf (file, "size %ld, %ld elements, %f collision/search ratio\n",
(long) expr_table->size (),
(long) expr_table->elements (),
fprintf (file, "size " HOST_SIZE_T_PRINT_DEC ", " HOST_SIZE_T_PRINT_DEC
" elements, %f collision/search ratio\n",
(fmt_size_t) expr_table->size (),
(fmt_size_t) expr_table->elements (),
expr_table->collisions ());
if (!expr_table->is_empty ())
{

View file

@ -230,9 +230,10 @@ dump_dfa_stats (FILE *file)
fprintf (file, "\n");
if (dfa_stats.num_phis)
fprintf (file, "Average number of arguments per PHI node: %.1f (max: %ld)\n",
fprintf (file, "Average number of arguments per PHI node: %.1f (max: "
HOST_SIZE_T_PRINT_DEC ")\n",
(float) dfa_stats.num_phi_args / (float) dfa_stats.num_phis,
(long) dfa_stats.max_num_phi_args);
(fmt_size_t) dfa_stats.max_num_phi_args);
fprintf (file, "\n");
}

View file

@ -1707,9 +1707,10 @@ debug_tree_ssa (void)
static void
htab_statistics (FILE *file, const hash_table<var_info_hasher> &htab)
{
fprintf (file, "size %ld, %ld elements, %f collision/search ratio\n",
(long) htab.size (),
(long) htab.elements (),
fprintf (file, "size " HOST_SIZE_T_PRINT_DEC ", " HOST_SIZE_T_PRINT_DEC
" elements, %f collision/search ratio\n",
(fmt_size_t) htab.size (),
(fmt_size_t) htab.elements (),
htab.collisions ());
}

View file

@ -1482,9 +1482,10 @@ record_equivalences_from_incoming_edge (basic_block bb,
static void
htab_statistics (FILE *file, const hash_table<expr_elt_hasher> &htab)
{
fprintf (file, "size %ld, %ld elements, %f collision/search ratio\n",
(long) htab.size (),
(long) htab.elements (),
fprintf (file, "size " HOST_SIZE_T_PRINT_DEC ", " HOST_SIZE_T_PRINT_DEC
" elements, %f collision/search ratio\n",
(fmt_size_t) htab.size (),
(fmt_size_t) htab.elements (),
htab.collisions ());
}

View file

@ -5882,9 +5882,10 @@ decl_fini_priority_insert (tree decl, priority_type priority)
static void
print_debug_expr_statistics (void)
{
fprintf (stderr, "DECL_DEBUG_EXPR hash: size %ld, %ld elements, %f collisions\n",
(long) debug_expr_for_decl->size (),
(long) debug_expr_for_decl->elements (),
fprintf (stderr, "DECL_DEBUG_EXPR hash: size " HOST_SIZE_T_PRINT_DEC ", "
HOST_SIZE_T_PRINT_DEC " elements, %f collisions\n",
(fmt_size_t) debug_expr_for_decl->size (),
(fmt_size_t) debug_expr_for_decl->elements (),
debug_expr_for_decl->collisions ());
}
@ -5893,9 +5894,10 @@ print_debug_expr_statistics (void)
static void
print_value_expr_statistics (void)
{
fprintf (stderr, "DECL_VALUE_EXPR hash: size %ld, %ld elements, %f collisions\n",
(long) value_expr_for_decl->size (),
(long) value_expr_for_decl->elements (),
fprintf (stderr, "DECL_VALUE_EXPR hash: size " HOST_SIZE_T_PRINT_DEC ", "
HOST_SIZE_T_PRINT_DEC " elements, %f collisions\n",
(fmt_size_t) value_expr_for_decl->size (),
(fmt_size_t) value_expr_for_decl->elements (),
value_expr_for_decl->collisions ());
}
@ -6287,9 +6289,10 @@ type_hash_canon (unsigned int hashcode, tree type)
static void
print_type_hash_statistics (void)
{
fprintf (stderr, "Type hash: size %ld, %ld elements, %f collisions\n",
(long) type_hash_table->size (),
(long) type_hash_table->elements (),
fprintf (stderr, "Type hash: size " HOST_SIZE_T_PRINT_DEC ", "
HOST_SIZE_T_PRINT_DEC " elements, %f collisions\n",
(fmt_size_t) type_hash_table->size (),
(fmt_size_t) type_hash_table->elements (),
type_hash_table->collisions ());
}

View file

@ -7335,8 +7335,8 @@ dump_var (variable *var)
for (i = 0; i < var->n_var_parts; i++)
{
fprintf (dump_file, " offset %ld\n",
(long)(var->onepart ? 0 : VAR_PART_OFFSET (var, i)));
fprintf (dump_file, " offset " HOST_WIDE_INT_PRINT_DEC "\n",
var->onepart ? 0 : VAR_PART_OFFSET (var, i));
for (node = var->var_part[i].loc_chain; node; node = node->next)
{
fprintf (dump_file, " ");

View file

@ -4365,7 +4365,7 @@ output_constant_pool_contents (struct rtx_constant_pool *pool)
p = label;
if (desc->offset)
{
sprintf (buffer, "%s+%ld", p, (long) (desc->offset));
sprintf (buffer, "%s+" HOST_WIDE_INT_PRINT_DEC, p, desc->offset);
p = buffer;
}
ASM_OUTPUT_DEF (asm_out_file, name, p);