From 610f66a3d14e56dee60cd542579ffbf14f803d80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Henry=20Linjam=C3=A4ki?= Date: Fri, 17 Nov 2017 14:00:46 +0000 Subject: [PATCH] [BRIGFE] Fix sprintf format string type mismatch on 32b machines. From-SVN: r254870 --- gcc/brig/ChangeLog | 5 +++++ gcc/brig/brigfrontend/brig-util.cc | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/brig/ChangeLog b/gcc/brig/ChangeLog index 17cc3bc1c42..ba07ca39e36 100644 --- a/gcc/brig/ChangeLog +++ b/gcc/brig/ChangeLog @@ -1,3 +1,8 @@ +2017-11-17 Henry Linjamäki + + * brigfrontend/brig-util.cc: Fix sprintf format string type mismatch + on 32b machines. + 2017-11-16 Henry Linjamäki Change internal representation of HSA registers. Instead diff --git a/gcc/brig/brigfrontend/brig-util.cc b/gcc/brig/brigfrontend/brig-util.cc index ca93247e7ff..f8b6832c00c 100644 --- a/gcc/brig/brigfrontend/brig-util.cc +++ b/gcc/brig/brigfrontend/brig-util.cc @@ -505,9 +505,10 @@ gccbrig_hsa_reg_id (const BrigOperandRegister ®) } std::string -gccbrig_hsa_reg_name_from_id (size_t reg_hash) +gccbrig_hsa_reg_name_from_id (size_t reg_id) { char reg_name[32]; + long unsigned int reg_hash = (long unsigned int) reg_id; if (reg_hash < BRIG_2_TREE_HSAIL_C_REG_COUNT) { sprintf (reg_name, "$c%lu", reg_hash); @@ -556,7 +557,7 @@ gccbrig_print_reg_use_info (FILE *dump, const regs_use_index &info) reg_use_it end_it2 = info.m_type_refs.end (); for (reg_use_it it2 = begin_it2; it2 != end_it2; it2++) { - fprintf (dump, "(%lu) ", it2->second); + fprintf (dump, "(%lu) ", (long unsigned int) it2->second); print_node_brief (dump, "", it2->first, 0); fprintf (dump, "\n"); } -- 2.30.2