From: Henry Linjamäki Date: Fri, 17 Nov 2017 14:00:46 +0000 (+0000) Subject: [BRIGFE] Fix sprintf format string type mismatch on 32b machines. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=610f66a3d14e56dee60cd542579ffbf14f803d80;p=gcc.git [BRIGFE] Fix sprintf format string type mismatch on 32b machines. From-SVN: r254870 --- 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"); }